bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically insert closing quote for string literals in languages that support it

bobbylight opened this issue · comments

Describe the solution you'd like
When typing aa string literal, RSTA should automatically insert the closing quote. Further, when typing the closing quote, it should be overwritten rather than a duplicate quote inserted. This is a nice quality-of-life feature in many code editors today that helps prevent accidentally creating malformed string literals.

Are there any workarounds?
None other than implementing it yourself via Actions and InputMap.

Additional context
The only tricky part is deciding whether the current langugae supports quoted strings at the current caret position. In some instances, such as plain text files, we should not insert a closing quote.