aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexPython.cxx
diff options
context:
space:
mode:
authorJohn Ehresman <unknown>2017-03-10 08:57:25 +1100
committerJohn Ehresman <unknown>2017-03-10 08:57:25 +1100
commit43cd19e34362bb637d4deb7677c835f00d82766b (patch)
treec15c981d7b72b5379fc1f4cbc315057402608e3b /lexers/LexPython.cxx
parent8b6cb02f80387900baf8b9166bcf332bcf778a38 (diff)
downloadscintilla-mirror-43cd19e34362bb637d4deb7677c835f00d82766b.tar.gz
Bug [#1918]. Fix failure when lexing starts at line 3+ of a multiline f-string.
Diffstat (limited to 'lexers/LexPython.cxx')
-rw-r--r--lexers/LexPython.cxx3
1 files changed, 2 insertions, 1 deletions
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<int, std::vector<SingleFStringExpState> >::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()) {