FR: Code Fold Selected text?

Post Reply
sl23
Posts: 211
Joined: 29.01.2013 10:04

FR: Code Fold Selected text?

Post by sl23 »

Would it be possible to select some text and Right-Click and have options to fold/unfold the selected sections in full?
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3004
Joined: 25.08.2021 18:15

Re: FR: Code Fold Selected text?

Post by main Alexey »

Cmd Palette has command for this: "fold selected lines". it works best when no lexer is active.
sl23
Posts: 211
Joined: 29.01.2013 10:04

Re: FR: Code Fold Selected text?

Post by sl23 »

Ah ok, that's great, I really only need Fold mostly. But would it be possible to have a Toggle Fold command? Just to reduce buttons. Because the toolbar gets overcrowded if you have to have a button to do both things separately.

I don't suppose there's a plugin for adding these to the Editor's Context Menu?

Thank you.

EDIT: Shame, doesn't seem to work for INI files! :(
Live for an ideal and leave no place in the mind for anything else.
main Alexey
Posts: 3004
Joined: 25.08.2021 18:15

Re: FR: Code Fold Selected text?

Post by main Alexey »

Now I see that command 'fold sel lines' is not compatible with tree-helpers like Markdown, Ini files. I will add note in my todo-list for future.


>there's a plugin for adding these to the Editor's Context Menu?

Using the Configure_Menu plugin, you can add commands to the context-menu. See the 'Configure Menu' topic at https://wiki.freepascal.org/CudaText_plugins


>But would it be possible to have a Toggle Fold command?

sorry, no such Toggle command. you need to use another command from Cmd Palette, like 'toggle block at current line' or 'unfold block at current line'.
sl23
Posts: 211
Joined: 29.01.2013 10:04

Re: FR: Code Fold Selected text?

Post by sl23 »

ok, that's great, thanks Alexey! ;)
Live for an ideal and leave no place in the mind for anything else.
Post Reply