Closed mtoohey31 closed 2 years ago
Actually the fix may be simpler than I thought, is there any need to reload the buffer here if we're just showing the status? Will npm
ever update the package.json
if we're just checking the outdated dependencies?
I'm testing the removal of the line above now, if I don't run into any bugs do you want me to open a pull request?
I'm testing the removal of the line above now, if I don't run into any bugs do you want me to open a pull request?
Sure!
Issues
Plugin Version
Neovim Version
Neovim Version
v0.5.1
Branch
master
Actual behavior
The
:e
command here triggers the autocommand here when autostart is enabled leading to the buffer being reloaded multiple times.Expected behavior
Show should not be triggered again if it is already running.
Steps to reproduce
First, enable autostart. If you throw print statements at the start of the
show
command (maybe with something likeos.clock()
appeneded so you can see changes between multiple occurrences), you'll see that it runs multiple times after entering a buffer.Package info config
Other information
No response
Help
Yes, but I don't know how to start. I would need guidance (check question below)
Implementation help
There's probably multiple ways to do this, not sure what's best, we could maybe set some kind of global variable and check if it's set before running the show command when entering a buffer. If I swap
:e
to:noa e
(which disables the trigger of autocommands), theshow
command is only run once, but this prevents other plugins that rely on autocommands from working, so that's not a feasible solution.