Are there commands to jump to next fold

Post Reply
egfips
Posts: 11
Joined: 13.05.2026 03:28

Are there commands to jump to next fold

Post by egfips »

Hi,

I scanned through the list of commands as carefully as I could, but cannot find what I am looking for. Perhaps just looking for the wrong name, perhaps it's not available.

What I am looking for are commands to
  • jump to the next/previous fold
  • jump to the next/previous function
  • jump to next/previous heading in markdown files
Thanks
main Alexey
Posts: 3108
Joined: 25.08.2021 18:15

Re: Are there commands to jump to next fold

Post by main Alexey »

yes, I looked at the Command Palette, and at CudaExt addon, no such commands.
they can be created. in new plugin, which maybe then can be merged to CudaExt. API has ed.folding() for this.

eg for C-lexer text:

Code: Select all

{
    
    
    
}
{
    
    
    
}
console command shows:

Code: Select all

>>> =ed.folding(FOLDING_ENUM)
[{'x': 0, 'y': 0, 'x2': 1, 'y2': 4, 'staple': True, 'folded': False, 'hint': '{ ... }', 'tag': 0}, {'x': 0, 'y': 5, 'x2': 1, 'y2': 9, 'staple': True, 'folded': False, 'hint': '{ ... }', 'tag': 0}]
this is folding getting. now plugin needs to find the 'next range' from caret pos, and put caret to different pos. API ed.set_caret().
Post Reply