sheerun / vim-polyglot

A solid language pack for Vim.
5.59k stars 295 forks source link

polyglot#detect#H() causes screen and cursor locations to skip around on BufWritePost #814

Open mqudsi opened 2 years ago

mqudsi commented 2 years ago

Does this bug happen when you install plugin without vim-polyglot?

Unknown what this plugin is.

Describe the bug:

When call polyglot#detect#H() is executed via auto BufWritePost, the screen and cursor locations change (jump around) after :w.

To Reproduce:

Edit a complicated C++ header file. Scroll to a random location in the file. Execute :w and observe the screen location and cursor location will change.

More info

polyglot also runs the same short sequence of code over and over again hundreds of times in a loop upon BufWritePost and I can't find a good reason for that.

The following was obtained after set verbosefile=... and set verbose=15 then executing :w with a C++ header file opened: polyglot_h.log