Repeat Last Command?

Post Reply
hexaae
Posts: 69
Joined: 25.02.2019 20:47

Repeat Last Command?

Post by hexaae »

Is there a shortcut (F4?) to instantly repeat last command (any command, edit command or plugin command...)?
It could be handy if you have to apply it to multiple lines manually, so you can move to the wanted line and F4, next line F4, skip to another line with cursor keys and F4 again...
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Command palette: 'repeat last text command'.
How to set hotkey? F9 in the command palette.
hexaae
Posts: 69
Joined: 25.02.2019 20:47

Post by hexaae »

main Alexey wrote:Command palette: 'repeat last text command'.
How to set hotkey? F9 in the command palette.
Thanks but this will work only for "text commands" unfortunately, not with operations through plugins...
For example I've used the Plugin > Cuda-Ext > Align > Re-Wrap/split lines by margin... and set 90.
I'd like to repeat this (including 90 chars margin) every time I press F4 manually moving to selected lines only.
It would be very handy.
I see I can repeat last plugin command too with a shortcut, but this will just trigger the plugin function (in this case will ask every time to set the margin to 90).
It would be great a real generic "repeat last action" (the real action done to the text, not a call to a plugin function...).
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

>real generic "repeat last action" (the real action done to the text, not a call to a plugin function...).

That is not possible yet. what is possible: 2nd CudaExt command "Re-wrap/split lines by margin, with defaults". It uses CudaText option 'margin_right' , as you see from source of CudaExt

Code: Select all

def rewrap_sel_by_margin_def():
...
    margin  = apx.get_opt('margin_right', 0)
    if margin==0:
        return app.msg_status(_('Set the margin via "Plugins / Cuda-Ext / Paragraph / Align: Configure..."'))
    lex     = ed.get_prop(app.PROP_LEXER_FILE, '')
    cmt_sgn = app.lexer_proc(app.LEXER_GET_PROP, lex)['c_line']     if lex else ''

    rewrap_sel_by_margin_ex(margin, cmt_sgn, True)
   #def rewrap_sel_by_margin_def
So set "margin_right":90 in user.json.
Post Reply