mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 00:47:50 +00:00
Improved comment/string excluded range detection for auto-pair insertion
This commit is contained in:
1 parent
ea8cc51eef
commit
235fd3b3f3
2 files changed
+13
-2
No files matched your search
@@ -2375,7 +2375,7 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
// Auto-pair insertion: when opening a quote/brace/bracket is typed,
|
||||
// insert a matching closer and place caret between the pair.
|
||||
// But only if the current position is not excluded (e.g., inside a comment or string)
|
||||
if (!container.getDocument().isExcluded(cursorPos)) {
|
||||
if (!container.getDocument().isExcludedInclusive(cursorPos)) {
|
||||
if (c == '"') {
|
||||
setText(before + "\"\"" + after, true);
|
||||
selection.reset(before.length() + 1);
|
||||
|
||||
Reference in new issue
Block a user