Author Topic: BUG: Keyboard macros in vi emulation mode not working  (Read 4273 times)

svatem1

  • Community Member
  • Posts: 10
  • Hero Points: 1
BUG: Keyboard macros in vi emulation mode not working
« on: September 01, 2008, 10:24:03 AM »
Hi,
I have file full of lines with following structure: "X COPIED 000034 some variable interesting stuff" where I'm only interested in some variable interesting stuff. I work in vi emulation mode, so naturally following key sequence (inside quotes) "0dfDdt " does exactly what I need. However, when I try to bind this to temporary macro (Ctrl+F11) and immediatelly try to execute it with Ctrl+F12 (execute-last-macro) I get error message saying "invalid delete sequence" and only the 1st word is deleted. Neither using altertnative bindings for starting/stopping macro recording helps. I've bounded it to temporary key sequence via Ctrl+Shift+F11 x in order to see what's been recorded, it could help:

#include "slick.sh"
_command last_recorded_macro_x() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
   _macro('R',1);
   last_event(name2event('0'));vi_begin_line();
   vi_get_event('SP');
   vi_get_event('SP');
   vi_get_event('','D');
   vi_get_event('','f');
   last_event(name2event('d'));vi_delete();
   vi_get_event('SP');
   vi_get_event('SP');
   vi_get_event('',' ');
   vi_get_event('','t');
   last_event(name2event('d'));vi_delete();
   last_event(name2event('j'));vi_next_line();
}

Thanks for help, Martin
« Last Edit: September 02, 2008, 02:15:43 PM by svatem1 »

svatem1

  • Community Member
  • Posts: 10
  • Hero Points: 1
Re: Keyboard macros in vi emulation mode
« Reply #1 on: September 01, 2008, 01:40:33 PM »
Next question - very powerfull feature of vi(m) is using recorded macros in conjunction with n-times repeat command, like "10 @q", where "q" is some pre-recorded macro, is that somehow possible in slickedit?
Martin