From 43cd19e34362bb637d4deb7677c835f00d82766b Mon Sep 17 00:00:00 2001 From: John Ehresman Date: Fri, 10 Mar 2017 08:57:25 +1100 Subject: Bug [#1918]. Fix failure when lexing starts at line 3+ of a multiline f-string. --- lexers/LexPython.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lexers/LexPython.cxx') diff --git a/lexers/LexPython.cxx b/lexers/LexPython.cxx index bc4bc877b..f667cb32c 100644 --- a/lexers/LexPython.cxx +++ b/lexers/LexPython.cxx @@ -511,8 +511,9 @@ void SCI_METHOD LexerPython::Lex(Sci_PositionU startPos, Sci_Position length, in // Set up fstate stack from last line and remove any subsequent ftriple at eol states std::map >::iterator it; it = ftripleStateAtEol.find(lineCurrent - 1); - if (it != ftripleStateAtEol.end()) { + if (it != ftripleStateAtEol.end() && !it->second.empty()) { fstringStateStack = it->second; + currentFStringExp = &fstringStateStack.back(); } it = ftripleStateAtEol.lower_bound(lineCurrent); if (it != ftripleStateAtEol.end()) { -- cgit v1.2.3