From e81ac898c0d6703f943d4e12b65fea435c974f10 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 13 Oct 2015 12:16:04 +0200 Subject: [PATCH] Enhance auto-insert for quotes and double quotes Enhance auto-insert behaviour for quotes and double quotes inside of parenthesis or bracket. --- PowerEditor/src/ScitillaComponent/AutoCompletion.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index 7b73afe3b..d687e5afb 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -575,7 +575,10 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m } } - if (isCharPrevBlank && isCharNextBlank) + if ((isCharPrevBlank && isCharNextBlank) || + (charPrev == '(' && charNext == ')') || (charPrev == '(' && isCharNextBlank) || (isCharPrevBlank && charNext == ')') || + (charPrev == '[' && charNext == ']') || (charPrev == '[' && isCharNextBlank) || (isCharPrevBlank && charNext == ']') || + (charPrev == '{' && charNext == '}') || (charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}')) { matchedChars = "\""; _insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1)); @@ -596,7 +599,10 @@ void AutoCompletion::insertMatchedChars(int character, const MatchedPairConf & m } } - if (isCharPrevBlank && isCharNextBlank) + if ((isCharPrevBlank && isCharNextBlank) || + (charPrev == '(' && charNext == ')') || (charPrev == '(' && isCharNextBlank) || (isCharPrevBlank && charNext == ')') || + (charPrev == '[' && charNext == ']') || (charPrev == '[' && isCharNextBlank) || (isCharPrevBlank && charNext == ']') || + (charPrev == '{' && charNext == '}') || (charPrev == '{' && isCharNextBlank) || (isCharPrevBlank && charNext == '}')) { matchedChars = "'"; _insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1));