I've used Akelpad for a long time for text files only, recently began using it for Javascript and PHP files, with code folding - it's working great.
Trying folding in the Python coder, it seems that I either have an outdated version (10-09-2016), or maybe some/most code folding is not implemented?
I've tried to screen the group for answers to this, but no obvious hits.
python.coder folding
- Author
- Message
-
Offline
- Posts: 1250
- Joined: Thu Nov 16, 2006 11:53 am
- Location: Kyiv, Ukraine
Re: python.coder folding
Looks like code folding for `if`, `for`, `with` etc. is not supported because of indentation-based syntax in Python.
If we look at the "CodeFold" section of AkelPad's .coder files, it mentions "fold start" and "fold end", and nothing about indentations. Most likely, the Coder plugin currently does not support indentation-based folding.
If we look at the "CodeFold" section of AkelPad's .coder files, it mentions "fold start" and "fold end", and nothing about indentations. Most likely, the Coder plugin currently does not support indentation-based folding.
-
Offline
- Posts: 2
- Joined: Sun Apr 04, 2021 6:42 am
Thank you - I also think it's a bit uphill to code the folding from scratch.
I might be content (for now) with folding of just 'class' and 'def'.
The code below aims to improve python.coder by correcting the error where non-indented code is 'folding-swallowed' by a preceding def or class.
The folding marker for level 1 is now terminated correctly at a blank line.
In my quick test level 1 class/def seem to fold correctly - there are still problems with folding of inner class/def.
Old code in folds: section:
Replace by:
I'm sure there are better ways to do it, but I'm not into plugin coding.
I might be content (for now) with folding of just 'class' and 'def'.
The code below aims to improve python.coder by correcting the error where non-indented code is 'folding-swallowed' by a preceding def or class.
The folding marker for level 1 is now terminated correctly at a blank line.
In my quick test level 1 class/def seem to fold correctly - there are still problems with folding of inner class/def.
Old code in folds: section:
Code: Select all
;173=1+4+8+32+128
;173 0 0 0 "class" "class" " " 0 0
;173 0 0 0 "def" "def" " " 0 0
;173 0 0 0 "def" "class" " " 0 0
Code: Select all
;3145901=1+4+8+32+128+1048576+2097152
3145901 0 0 0 "^[ \t]*(class|def)" "^\s*\n\S.*" " " 0 0