You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
In (at least) Python syntax highlighting, the character after the quote you just closed can be removed/overwritten.
<speculation>
This appears to be caused by the token maker. In the exact same scenario for Java, there will be a token "something with a type of ERROR_STRING_DOUBLE. But for Python, you get a token "something with a type of LITERAL_STRING_DOUBLE_QUOTE. This leads to a different branch in InsertQuoteAction, specifically this one:
if (tokenType == quoteType.validTokenType) {
if (offs == t.getEndOffset() - 1) {
textArea.moveCaretPosition(offs + 1); // Force a replacement to ensure undo is contiguoustextArea.replaceSelection(stringifiedQuoteTypeCh);
textArea.setCaretPosition(offs + 1);
}
This seems to be the cause of the issue, with the root being the token type spit out by the token maker. </speculation>
Steps to Reproduce
Type a string such as str("something) into an RSyntaxTextArea with Python syntax highlighting.
Set the caret position between g and ).
Enter a double quote.
Here's a test case that reproduces in RSyntaxTextAreaEditorKitInsertQuoteActionTest:
For a simple workaround (since my application will only ever be using Python in these editors), I'm simply overwriting the entry in the action map with base InsertPairedCharacterAction behavior:
Description
In (at least) Python syntax highlighting, the character after the quote you just closed can be removed/overwritten.
<speculation>
This appears to be caused by the token maker. In the exact same scenario for Java, there will be a token
"something
with a type ofERROR_STRING_DOUBLE
. But for Python, you get a token"something
with a type ofLITERAL_STRING_DOUBLE_QUOTE
. This leads to a different branch inInsertQuoteAction
, specifically this one:This seems to be the cause of the issue, with the root being the token type spit out by the token maker.
</speculation>
Steps to Reproduce
str("something)
into an RSyntaxTextArea with Python syntax highlighting.g
and)
.Here's a test case that reproduces in
RSyntaxTextAreaEditorKitInsertQuoteActionTest
:Expected behavior
Double quotes should be closed 'correctly' without overtyping.
I'll also note, for the sake of it, that single quotes work just fine.
The text was updated successfully, but these errors were encountered: