Hello, is there a way to make a command for switching the option caret_after_end, to add it into menu or bind it to a hotkey?
I am changing it in the user.json now... maybe there is another way to do it?
Plugin to toggle "Caret after end" option
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Caret after end
It can be binded to a hotkey, if new small plugin is made. Then bind hotkey to this plugin.
plugin code must just toggle PROP_CARET_VIRTUAL via ed.set_prop().
call "Plugins / Make plugin".
fill code file with this:
plugin code must just toggle PROP_CARET_VIRTUAL via ed.set_prop().
call "Plugins / Make plugin".
fill code file with this:
Code: Select all
from cudatext import *
class Command:
def run(self):
op = ed.get_prop(PROP_CARET_VIRTUAL, '')
ed.set_prop(PROP_CARET_VIRTUAL, not op)
Re: Caret after end
Thank you, this works.
One question though, I put it it into menu, but is it possible to get a check box to the menu item?
One question though, I put it it into menu, but is it possible to get a check box to the menu item?
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: Caret after end
Auto change of checkmark is not possible; only this is possible: plugin finds the custom menu item in top menu using menu_proc(), and changes the checkmark.
Re: Plugin to toggle "Caret after end" option
Ok, I'll look into it... thank you.