ej-shafran / compile-mode.nvim

A plugin for Neovim inspired by Emacs' Compilation Mode
The Unlicense
50 stars 12 forks source link

[FEAT] Add User autocommand to notify finished compilation #36

Closed Tonelllo closed 1 month ago

Tonelllo commented 1 month ago

Emacs Interop

Feature Suggestion

I am really liking this plugin so far. I would find useful to have the possibility to run an autocommand when the compilation is finished but at the moment I don't see an easy way of doing so.

The easiest way I think would be to trigger an autocommand when The compilation is finished. For example adding the following lines in "/lua/compile-mode/init.lua" line 286:

  vim.api.nvim_exec_autocmds("User", {
    pattern = "CompilationFinished",
    data = { CompileMessage = compilation_message },
  })

This is not a feature of Emacs' compilation-mode, but for what I could find it should be easily achievable by using an hook.

ej-shafran commented 1 month ago

Sounds totally fair. Will implement this.

ej-shafran commented 1 month ago

I've pushed to nightly with a change similar to what we discussed. Mind giving it a look and letting me know if it fits your usecase?

Tonelllo commented 1 month ago

Yes, it fits what I was asking perfectly. Fantastic job even with the documentation.