Some python code structures are not recognised when there is a comment or a blank line for the first line of the body. This happens for if statements, else statements, while loops and functions definitions. Reproducible: Always Steps to Reproduce: if a == 3: print 'a==3' if a == 3: # print 'a==3' def test(): t = 5 return t def test(): #test t = 5 return t Actual Results: No code folding marker appears. Expected Results: a code folding marker should appear for these cases since this is acceptable python.
I get the folding marks for the blocks with a comment, but not for the ones with a blank line. Arch Linux 64-bit Kate 16.04.2 KDE Frameworks 5.22.0 Qt 5.6.1 xcb wm
Valid bug, unfortunately ATM we only have one line look-ahead to 'know' if some line should start a new folding section. This means in these cases, that heuristic will fail, as the indentation level is not increased (because empty lines are skipped for that).
Still an issue as of 20.11.70
Still happens, but nothing will change if nobody provides at patch. I would consider this no real issue, as such code is strange, there is no reason to have empty lines after the start of such statements. Naturally, if somebody provides a patch, this can be improved, all these things are just imperfect heuristics. See on https://kate-editor.org/join-us/ how to contribute.
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/451 If somebody has time, please test this.
Must confess the initial example is still broken in my branch...
(In reply to Christoph Cullmann from comment #6) > Must confess the initial example is still broken in my branch... Should work now.