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

Improve pumvisible workaround in is_active? #481

Closed
blueyed opened this issue Feb 20, 2018 · 2 comments
Closed

Improve pumvisible workaround in is_active? #481

blueyed opened this issue Feb 20, 2018 · 2 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Feb 20, 2018

I've wondered about pumvisible() being used in gitgutter#utility#is_active (

), and found that it is meant as a workaround for when a preview window might be there.

It was added in f05fda9 to fix #310.

I think a better fix would be to check for the local previewwindow setting or something similar.

I have not investigated yet, but just started using vim-gitgutter and wanted to leave this here for now.

@airblade
Copy link
Owner

I think a better fix would be to check for the local previewwindow setting or something similar.

So similar to the way we check whether the buffer holds an ordinary file we could check whether the window is the preview window?

The trouble with window variables is that we only know the buffer number, not the window number. This is why the slightly awkward s:vimdiff() function exists.

Looking forward to hearing more on this...

@airblade
Copy link
Owner

I'm happy to leave the check for pumvisible() in place because I don't think we want gitgutter to run while the user is in the middle of a completion.

Gitgutter could additionally check whether the buffer it is processing is shown in a preview window – but if the preview window is showing a git-tracked file then we would probably want to see the diff signs if any.

I'll close this for now but happy to discuss further if you like.

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

2 participants