Page 1 of 1

Are there commands to jump to next fold

Posted: 18.07.2026 20:30
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

Re: Are there commands to jump to next fold

Posted: 22.07.2026 05:40
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().