Skip to content
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

An error is caused when I try to change trigger_events to bufLeave #48

Open
piliplaker opened this issue Aug 13, 2022 · 5 comments
Open

Comments

@piliplaker
Copy link

image
This is my configuration, It cause an error when I temporarily hide nvimtree menu, or when I try to close the welcome page provided by alpha-nvim.

the default autosave trigger event is a little too frequently and annoying when I am coding . But usually I do need to save my work from time to time , and in a way not that noticeable. So I overwrite the default like above.

The error does not cause any thing bad like data loss, It just annoying, in another way.

Am I do this wrong? Or is there any way to improve this?

Thank you for you time.

@nullishamy
Copy link

The plugin needs to check the buf is valid and writeable here https://github.com/Pocco81/auto-save.nvim/blob/main/lua/auto-save/init.lua#L95. Alternatively it could just run the condition before attempting to debounce, where the user could run such checks themselves.

@RamilGN
Copy link

RamilGN commented Aug 13, 2022

Same, this problem appears when i switch to another buffer with telescope buffer picker too fast.
config

@XXiaoA
Copy link
Contributor

XXiaoA commented Aug 15, 2022

This issue seems like #46 . And I have fixed it. Maybe you could try my fork

@nullishamy
Copy link

This issue seems like #46 . And I have fixed it. Maybe you could try my fork

Seems like an over-complicated fix, nvim_buf_is_valid does this?

@XXiaoA
Copy link
Contributor

XXiaoA commented Aug 15, 2022

This issue seems like #46 . And I have fixed it. Maybe you could try my fork

Seems like an over-complicated fix, nvim_buf_is_valid does this?

Thanks, it does! I didn't find out this api before

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

4 participants