Skip to content

Commit

Permalink
Fix Bash arithmetic expansion parenthesis counting bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed Nov 30, 2023
1 parent 42a8752 commit 65354fe
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scintilla/lexers/LexBash.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class QuoteStackCls { // Class to manage quote pairs that nest
}
bool CountDown(StyleContext &sc, CmdState &cmdState) {
Current.Count--;
if (Current.Count == 1 && sc.Match(')', ')')) {
while (Current.Count > 0 && sc.chNext == Current.Down) {
Current.Count--;
sc.Forward();
}
Expand Down Expand Up @@ -313,10 +313,6 @@ class QuoteStackCls { // Class to manage quote pairs that nest
style = QuoteStyle::Command;
cmdState = CmdState::Delimiter;
}
if (current == CmdState::Body && sc.ch == '(' && state == SCE_SH_DEFAULT && Depth == 0) {
// optimized to avoid track nested delimiter pairs
return;
}
} else {
// scalar has no delimiter pair
if (!IsBashParamStart(sc.ch, isCShell)) {
Expand Down

0 comments on commit 65354fe

Please sign in to comment.