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

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

Open
mqudsi opened this issue Sep 24, 2022 · 0 comments

Comments

@mqudsi
Copy link

mqudsi commented Sep 24, 2022

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

mqudsi added a commit to mqudsi/vim-polyglot that referenced this issue Mar 5, 2023
The detection code breaks :w by having the cursor jump around.
See sheerun#814
mqudsi added a commit to mqudsi/nvim-config that referenced this issue May 17, 2023
This resolves issues with C/C++ header files:
sheerun/vim-polyglot#814
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

1 participant