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

No autocmd when opening QuickFix window #1860

Closed
wants to merge 1 commit into from
Closed

No autocmd when opening QuickFix window #1860

wants to merge 1 commit into from

Conversation

andryandrew
Copy link
Contributor

Disables firing of autocommands when opening the QuickFix window.

Fixes #1595. While the bug is ultimately neovim's, firing a CursorMoved more often than in vim is a neovim design choice.

Disables firing of autocommands when opening the QuickFix window
@lervag
Copy link
Owner

lervag commented Nov 23, 2020

I'm curious if this would prevent running "important" or "desired" autocmds. E.g., I personally have

augroup quickfix_autocmds
  autocmd!
  autocmd BufReadPost quickfix call personal#qf#adjust_height()
augroup END

where adjust_height is used to adjust the height of the window. Would not this PR disable this particular autocmd?

@lervag
Copy link
Owner

lervag commented Nov 23, 2020

My simple test for this confirms my suspicion. Thus, I would prefer to not merge this and instead implement a different fix, if possible.

@andryandrew
Copy link
Contributor Author

andryandrew commented Nov 23, 2020

Oups, sorry 😅 I did not think this through enough.
We can just ignore the two culprits instead of all autocommands (with eventignore=CursorMoved,WinEnter)...

...but maybe it's better to go with a "redraw" just before the win_gotoid call? This too seems to fix the important part of the bug (the misbehaving motion keys), but leaves the "ghost" highlighting in the quickfix window.

Just a question though: why is the built-in matchparen still active alongside vimtex's own mechanism? Disabling it (or just loading it after vimtex's one, instead of before) also fixes the bug unfortunately, not in all situations.

@lervag
Copy link
Owner

lervag commented Nov 24, 2020

Oups, sorry sweat_smile I did not think this through enough.
We can just ignore the two culprits instead of all autocommands (with eventignore=CursorMoved,WinEnter)...

No problem! And if possible it seems like a good idea to ignore specific autocommands! I think the main autocommands that are relevant that we don't want to ignore are ones such as the one in my example.

...but maybe it's better to go with a "redraw" just before the win_gotoid call? This too seems to fix the important part of the bug (the misbehaving motion keys), but leaves the "ghost" highlighting in the quickfix window.

That also sounds like a simple and OK solution. It should be added with a relevant comment (e.g. linking to this PR for motivation).

Just a question though: why is the built-in matchparen still active alongside vimtex's own mechanism? Disabling it (or just loading it after vimtex's one, instead of before) also fixes the bug unfortunately, not in all situations.

Good question. I guess the simple answer is "because Vimtex tries not to interfere with other plugins"? Is there a simple way to disable it that would not lead to unexpected situations for the user (e.g. a user may expected matchparen to be active in some buffers, but not the LaTeX buffers)?

@lervag lervag closed this Mar 29, 2021
@lervag
Copy link
Owner

lervag commented Mar 29, 2021

Feel free to reopen if you have a proposal for an updated version.

@andryandrew
Copy link
Contributor Author

I can submit a PR with the redraw workaround, but apparently I cannot reopen this one (or I don't see how). Is it a permission issue?

@lervag
Copy link
Owner

lervag commented Jun 10, 2021

I can submit a PR with the redraw workaround,

Great, thanks, that would be appreciated!

but apparently I cannot reopen this one (or I don't see how). Is it a permission issue?

I have no idea. I can't reopen it either. So I guess you should just open a new PR. If/When you do, please link back to this PR and to the original issue, #1595 to help maintain the context.

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

Successfully merging this pull request may close these issues.

(Neo)Vim 'w' behaves like 'W' in a certain scenario
2 participants