diff --git a/scintilla/lexers/LexBash.cxx b/scintilla/lexers/LexBash.cxx index 8f27f892ee..732fdb6272 100644 --- a/scintilla/lexers/LexBash.cxx +++ b/scintilla/lexers/LexBash.cxx @@ -44,7 +44,7 @@ enum { #define HERE_DELIM_MAX 256 // state constants for parts of a bash command segment -enum class CmdState { +enum class CmdState : uint8_t { Body, Start, Word, @@ -57,7 +57,7 @@ enum class CmdState { // state constants for nested delimiter pairs, used by // SCE_SH_STRING, SCE_SH_PARAM and SCE_SH_BACKTICKS processing -enum class QuoteStyle { +enum class QuoteStyle : uint8_t { Literal, // '' CString, // $'' String, // "" @@ -203,7 +203,7 @@ class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl) int Up = '\0'; int Down = '\0'; QuoteStyle Style = QuoteStyle::Literal; - int Outer = SCE_SH_DEFAULT; + uint8_t Outer = SCE_SH_DEFAULT; CmdState State = CmdState::Body; void Clear() noexcept { Count = 0; @@ -218,7 +218,7 @@ class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl) Up = u; Down = opposite(Up); Style = s; - Outer = outer; + Outer = static_cast(outer); State = state; } }; @@ -651,7 +651,9 @@ void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle continue; } } else if (sc.ch == QuoteStack.Current.Up) { - QuoteStack.Current.Count++; + if (QuoteStack.Current.Style != QuoteStyle::Parameter) { + QuoteStack.Current.Count++; + } } else { if (QuoteStack.Current.Style == QuoteStyle::String || QuoteStack.Current.Style == QuoteStyle::HereDoc ||