diff options
author | Zufu Liu <unknown> | 2017-10-15 09:32:54 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2017-10-15 09:32:54 +1100 |
commit | 4d9fec4df948eea53dac295a7aeddbcd92b39ed9 (patch) | |
tree | 1b19a1820fac09ee2c3198cb871ef7bc61bb4949 /lexers/LexPython.cxx | |
parent | dfbe85f34adf4a6f5dbc9a0ed4790d7a844c2fc3 (diff) | |
download | scintilla-mirror-4d9fec4df948eea53dac295a7aeddbcd92b39ed9.tar.gz |
Bug [#1977]. Folder treats triple-quoted f-strings like triple-quoted strings.
Diffstat (limited to 'lexers/LexPython.cxx')
-rw-r--r-- | lexers/LexPython.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lexers/LexPython.cxx b/lexers/LexPython.cxx index ee60037fb..85e365351 100644 --- a/lexers/LexPython.cxx +++ b/lexers/LexPython.cxx @@ -836,7 +836,7 @@ static bool IsCommentLine(Sci_Position line, Accessor &styler) { static bool IsQuoteLine(Sci_Position line, const Accessor &styler) { const int style = styler.StyleAt(styler.LineStart(line)) & 31; - return ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE)); + return IsPyTripleQuoteStringState(style); } @@ -872,7 +872,7 @@ void SCI_METHOD LexerPython::Fold(Sci_PositionU startPos, Sci_Position length, i int prev_state = SCE_P_DEFAULT & 31; if (lineCurrent >= 1) prev_state = styler.StyleAt(startPos - 1) & 31; - int prevQuote = options.foldQuotes && ((prev_state == SCE_P_TRIPLE) || (prev_state == SCE_P_TRIPLEDOUBLE)); + int prevQuote = options.foldQuotes && IsPyTripleQuoteStringState(prev_state); // Process all characters to end of requested range or end of any triple quote //that hangs over the end of the range. Cap processing in all cases @@ -889,7 +889,7 @@ void SCI_METHOD LexerPython::Fold(Sci_PositionU startPos, Sci_Position length, i indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); Sci_Position lookAtPos = (styler.LineStart(lineNext) == styler.Length()) ? styler.Length() - 1 : styler.LineStart(lineNext); const int style = styler.StyleAt(lookAtPos) & 31; - quote = options.foldQuotes && ((style == SCE_P_TRIPLE) || (style == SCE_P_TRIPLEDOUBLE)); + quote = options.foldQuotes && IsPyTripleQuoteStringState(style); } const int quote_start = (quote && !prevQuote); const int quote_continue = (quote && prevQuote); |