mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 06:45:27 +02:00
Enhance auto-insert for quotes and double quotes
Enhance auto-insert behaviour for quotes and double quotes inside of parenthesis or bracket.
This commit is contained in:
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 = "\"";
|
matchedChars = "\"";
|
||||||
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1));
|
_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 = "'";
|
matchedChars = "'";
|
||||||
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1));
|
_insertedMatchedChars.add(MatchedCharInserted(char(character), caretPos - 1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user