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:
  func OpenLive(device string, snaplen int32, promisc bool, timeout
time.Duration) (handle *pcap.Handle, _ error)
  func OpenOffline(file string) (handle *pcap.Handle, err error)


where 552 is a cursor position from the beginning of the file.

Thanks,
Sergey.

2017-09-19 15:41 GMT+03:00 Sergey Naumov <sknau...@gmail.com>:

> Hi All.
>
> I'm trying to use macro in mcedit. Man says, that recoded macros should
> end up in ~/.local/share/mc/mc.macros file. Neither when I record a macro
> nor when I use "save setup" in mcedit or mc I do no see any updates in
> mc.macros. If I exit from mc and start it again, recorded macro get lost.
> If I manually try to describe a macro in mc.macros, I do not see it
> available in mcedit.
>
> So what I've tried:
> 1. Use Ctrl-r to record a macro: it works, but only until I exit from mc.
> 2. Put the following into ~/.local/share/mc/mc.macros:
> [editor]
> ctrl-space=EditWordLeftHighlight:-1;
>
> $ mc -V
> GNU Midnight Commander 4.8.19-65-g5e5f57c
> Built with GLib 2.48.0
> Using the S-Lang library with terminfo database
> With builtin Editor
> With subshell support as default
> With support for background operations
> With mouse support on xterm and Linux console
> With support for X11 events
> With internationalization support
> With multiple codepages support
> Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish
> Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
>
> Could you please tell me what I'm doing wrong.
>
> Thanks,
> Sergey.
>
_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel

Reply via email to