mhartington/formatter.nvim

[Feature request] Pass formatter data to autocommands

Opened this issue · 0 comments

Hey Mike,

I would like to notify myself when formatting takes place, it's easily done using FormatterPre/Post autocommands, but I would like to be able to display formatter that has been used to perform formatting. Would you be willing to accept PR for that? I think there is an option to pass arbitrary data from nvim_exec_autocmds, so I replaced https://github.com/mhartington/formatter.nvim/blob/master/lua/formatter/util.lua#L124 with that api call and tried to pass cmd used in formatter from https://github.com/mhartington/formatter.nvim/blob/master/lua/formatter/format.lua#L222, but would have to be returning cmd from run() function.

Is that something you would be interesting on merging should I get it to work?