Re: mc macro recording/editing issues

2017-09-20 Thread Andrew Borodin
On Wed, 20 Sep 2017 12:28:02 +0300 Sergey Naumov wrote: > But I will try to use macro too. > In the code (usermenu.c: expand_format()) I see that despite mcedit manual > mentions %c, it is not actually supported. > Could I fix %c and also add %C as file offset

Re: mc macro recording/editing issues

2017-09-20 Thread Sergey Naumov
AFAIU the call chain is the following: {"ExecuteScript", CK_PipeBlock (0)} /* CK_PipeBlock */ edit_block_process_cmd() -> user_menu() -> user_menu_cmd() -> execute_menu_command() -> expand_format() Therefore format of .local/share/mc/mcedit/macros.d/macro.*.sh is the same as for usermenu

Re: mc macro recording/editing issues

2017-09-20 Thread Sergey Naumov
Thanks, Yury. But I will try to use macro too. In the code (usermenu.c: expand_format()) I see that despite mcedit manual mentions %c, it is not actually supported. Could I fix %c and also add %C as file offset (WEdit.buffer.curs1)? Should I file a bug for it? Thanks, Sergey. 2017-09-19 20:16

Re: mc macro recording/editing issues

2017-09-19 Thread Yury V. Zaytsev
On Tue, 19 Sep 2017, Sergey Naumov wrote: Also is there a way for macros to get cursor position in a file in a form of offset from the beginning of the file? What I'm trying to achieve is to get some sort of autocompletion for golang using gocode, and it is done like this: I think you

Re: mc macro recording/editing issues

2017-09-19 Thread Sergey Naumov
Also is there a way for macros to get cursor position in a file in a form of offset from the beginning of the file? What I'm trying to achieve is to get some sort of autocompletion for golang using gocode, and it is done like this: # cat pcap-read.go | gocode autocomplete 552 Found 2 candidates: