Are there commands to jump to next fold

Post Reply
egfips
Posts: 13
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: 3110
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().
egfips
Posts: 13
Joined: 13.05.2026 03:28

Re: Are there commands to jump to next fold

Post by egfips »

I see, so, while not built in, it should be possible to implement. I'll first need to find out how to actually do that. Have to see when I can find the spare time for it. I guess I am like most people. For me an editor is a tool for working on the projects I need or want to work on. It's not supposed to be a project in its own right, diverting my energies.

I guess I can figure out how that code console thing works. You gave hints on how to implement the feature, so I might manage. Understanding how to do that might of course help in the future if I want something else. I think one of the problems in actually being successful is in understanding what underlying functionality exists that I can build on. Clearly in this case I will be fully dependent in the lexer to find the fold points or functions to jump to. Where do I find out what functionality the lexer provides and how to use it? Also you indicate that this is for C. I hope I don't need to implement a copy of this for every language?

Thanks
main Alexey
Posts: 3110
Joined: 25.08.2021 18:15

Re: Are there commands to jump to next fold

Post by main Alexey »

I will add this command by myself, also command to 'jump to prev range', as exchange for help: OK help if you make the youtube video review of the app. Not short review.
I don't ask money)
Last edited by main Alexey on 26.07.2026 18:55, edited 3 times in total.
main Alexey
Posts: 3110
Joined: 25.08.2021 18:15

Re: Are there commands to jump to next fold

Post by main Alexey »

Where do I find out what functionality the lexer provides and how to use it?
all lexers make 'fold ranges'. even C and HTML, etc. these regions are handled by API ed.folding() described in the 'API wiki'.
Also you indicate that this is for C. I hope I don't need to implement a copy of this for every language?
right. all lexers make similar fold ranges.
egfips
Posts: 13
Joined: 13.05.2026 03:28

Re: Are there commands to jump to next fold

Post by egfips »

Well thanks.
OK help if you make the youtube video review of the app. Not short review.
I would like to, but I am not a youtuber. I don't even have an account.

I would be happy to write a review though if there is somewhere reasonable to post it. My situation is that I have been using a high end editor for a very long time. But eventually I have become disillusioned. Something changed in how they do business and they screwed their existing loyal users over by just dropping their accounts. My editor still works, but I am cut off from updates, unless I buy new, which I will not do. So I was on the lookout for something in the open source space that would fit my needs. I always thought Notepad++ was a decent editor, but it is Windows only, so that is a non-starter.

There are numerous code editors around, but few really satisfy. My existing editor, despite its maturity, had many rough edges and too much complex functionality that I wouldn't use. CudaText is the only one I found so far that cuts all the clutter but still implements the features I have come to rely one. Some is actually implemented nicer than I was used to.
Post Reply