Skip to content

Different trigger_events for different FileType #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Andrew15-5 opened this issue Sep 3, 2023 · 1 comment
Open

Different trigger_events for different FileType #80

Andrew15-5 opened this issue Sep 3, 2023 · 1 comment

Comments

@Andrew15-5
Copy link

Andrew15-5 commented Sep 3, 2023

I want to have this for all file types:

auto_save.setup {
  execution_message,
  trigger_events = { "InsertLeave", "TextChanged" },
}

But this for typst:

auto_save.setup {
  execution_message,
  trigger_events = { "InsertLeave", "TextChanged", "TextChangedI" },
}

I can't get buffer's FileType on Neovim initialization, I can't re-setup the config. Can I check which event was triggered in the condition function? This way, I can cancel TextChangedI event for every non-typst buffer. But I would prefer per-FileType trigger_events.

Either way, can I somehow solve the problem now, or is this a feature request?

P.S. I still use init.vim and have almost 0 knowledge of Neovim's Lua API.

@primeapple
Copy link

primeapple commented Sep 4, 2023

Have a look at the more maintained fork https://github.com/okuuva/auto-save.nvim and crosspost the problem there.

For your problem: This looks interesting. I think we could implement something like that on the fork. Condition certainly looks like the wrong place to do this, tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants