Improved comment/string excluded range detection for auto-pair insertion

This commit is contained in:
bigguy345 committed 2026-01-26 21:52:04 +02:00
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);