Folding comments at the end of a python file

26 views
Skip to first unread message

John Ehresman

unread,
Apr 20, 2017, 1:36:26 PM4/20/17
to Scintilla mailing list
Normally python comments are assigned an indent level of the non-comment
line following them, at least when the foldCompact option is false. But
when there's no non-comment line following the comments, the indent
level of the last line ends up being used. The attached patch uses the
min comment line level instead. This changes the folding of the
following so the comments aren't folded along with the function body:

def function():
pass

# a comment
# another comment

Cheers,

John
ending-comments.diff

Neil Hodgson

unread,
Apr 21, 2017, 5:15:00 PM4/21/17
to Scintilla mailing list
John Ehresman:

> Normally python comments are assigned an indent level of the non-comment line following them, at least when the foldCompact option is false. But when there's no non-comment line following the comments, the indent level of the last line ends up being used. The attached patch uses the min comment line level instead.

Committed as
https://sourceforge.net/p/scintilla/code/ci/922c39166ff39f19654d159cec717fb749ed88a7/

Neil

Reply all
Reply to author
Forward
0 new messages