Menu

#1897 Python fold ends prematurely on missing indentation for multiline strings

Bug
open
4
2018-09-02
2017-01-01
b2f9h203
No
SciTE
Version 3.7.0 compiled for GTK+ 3.22.2
    Oct 31 2016 16:18:30
def f():
    sr = """
Hello
Multline string
"""
    print "not folded anymore, because multiline string is not indented"
    return sr

f()

When trying to fold def f() it is only folded up to and including sr = """ It seems to not be recognized that "Hello ..." and everything thereafter still belongs to function f.
This might be related: https://stackoverflow.com/questions/2504411/proper-indentation-for-python-multiline-strings
I'm not sure, but it seems to be valid python. I encountered this in the trash-cli source code.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2017-01-01
    • labels: --> scintilla, folder, python
    • assigned_to: Kacper Kasper
    • Priority: 5 --> 4
     
  • Neil Hodgson

    Neil Hodgson - 2017-01-01

    You may want to turn on the fold.quotes.python property.

     
  • b2f9h203

    b2f9h203 - 2017-01-02

    Adding

    fold.quotes.python=1
    

    to ~/.SciTEUser.properties works. Why is this not activated by default?

     
    • Neil Hodgson

      Neil Hodgson - 2017-01-02

      I can't recall but most likely that it has problems.

       
  • Zufu Liu

    Zufu Liu - 2018-09-02

    The bug maybe https://sourceforge.net/p/scintilla/bugs/193/ and a f-string bug (fixed, but can't find out the link), #193 and this I think is fixed.

     

Log in to post a comment.