From ec85ede0490f6c8b0f7db3d42566d06fc07edb4f Mon Sep 17 00:00:00 2001 From: Hiro Date: Tue, 20 Aug 2024 17:33:02 +0800 Subject: [PATCH] --bugfix=TextMateSymbolPairMatch.SymbolPairEx.shouldReplace add isSurroundingPair judgement when no text was selected. --- .../rosemoe/sora/langs/textmate/TextMateSymbolPairMatch.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/language-textmate/src/main/java/io/github/rosemoe/sora/langs/textmate/TextMateSymbolPairMatch.java b/language-textmate/src/main/java/io/github/rosemoe/sora/langs/textmate/TextMateSymbolPairMatch.java index 17f0e4c94..ae0a21388 100644 --- a/language-textmate/src/main/java/io/github/rosemoe/sora/langs/textmate/TextMateSymbolPairMatch.java +++ b/language-textmate/src/main/java/io/github/rosemoe/sora/langs/textmate/TextMateSymbolPairMatch.java @@ -172,6 +172,10 @@ public boolean shouldReplace(CodeEditor editor, ContentLine contentLine, int lef if (editor.getCursor().isSelected()) { return isSurroundingPair; } + // No text was selected,so should not complete surrounding pair + if (isSurroundingPair) { + return false; + } if (notInTokenTypeArray == null) { return true;