Enhance auto-insert for quotes and double quotes
Enhance auto-insert behaviour for quotes and double quotes inside of parenthesis or bracket.pull/1003/head
parent
963d7fc885
commit
e81ac898c0
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue