Closed echo-e closed 6 months ago
Simplified as:
for ((i = 0; i < 2; i++)); do
echo $(((1) << i)) # colored as shift operator
done
for ((i = 0; i < 2; i++)); do
echo $((((1)) << i)) # colored as here-doc
done
patch to fix the bug: 215.patch
diff --git a/lexers/LexBash.cxx b/lexers/LexBash.cxx
index 157af818..199172ec 100644
--- a/lexers/LexBash.cxx
+++ b/lexers/LexBash.cxx
@@ -333,7 +333,7 @@ public:
}
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();
}
@@ -380,10 +380,6 @@ public:
sc.ChangeState(SCE_SH_BACKTICKS);
}
}
- if (current == CmdState::Body && sc.Match('(', '(') && state == SCE_SH_DEFAULT && Depth == 0) {
- // optimized to avoid track nested delimiter pairs
- style = QuoteStyle::Literal;
- }
} else {
// scalar has no delimiter pair
if (!setParamStart.Contains(sc.ch)) {
Looks good since its a simplification - committed.
Originally reported as bug #1940 in Notepad++. The Shell language bitwise shift operator (as when used between
(( ))
) may be interpreted as a heredoc redirect. This has been partially fixed since originally reported in 2016, but I have found a new variant of the problem with this code snippet:I've verified that SciTE v5.4.0 also suffers from this error.