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

Window sometimes doesn't jump to error unless focused #284

Open
augustjanse opened this issue Aug 16, 2019 · 10 comments
Open

Window sometimes doesn't jump to error unless focused #284

augustjanse opened this issue Aug 16, 2019 · 10 comments

Comments

@augustjanse
Copy link

When I type :Dispatch, :Dispatch make is opened in a small split. It prints the output as expected, but then jumps to the top. Only when I focus on this small split does it jump to the properly highlighted error.

Sometimes it does jump to the highlighted error without focusing. The first time I run :Dispatch in a new session, it always does this.

I'm running Vim in the Git Bash window on Windows.

@tpope
Copy link
Owner

tpope commented Aug 17, 2019

What if you press <C-L> to force a redraw without focusing the window? Does that fix the positioning?

@augustjanse
Copy link
Author

Nope, it had no effect. :redraw! didn't do anything either.

(For unrelated reasons, I switched to Vim in MSYS2 before trying, but it's exhibiting the same behavior.)

@tpope
Copy link
Owner

tpope commented Aug 19, 2019

Try with a slow script and see if that illuminates when and how it fails. Something like:

for i in $(seq 1 20); do
  sleep 1
  echo $i
done

@augustjanse
Copy link
Author

Not sure I understand what you want me to do. It printed the output and then jumped to the top as I would expect.

@tpope
Copy link
Owner

tpope commented Aug 19, 2019

This is the correct behavior. What happens if you take out the sleep?

@augustjanse
Copy link
Author

It blinks empty before drawing 1-10 at once (same end result as previous screenshot).

@tpope
Copy link
Owner

tpope commented Aug 19, 2019

I guess I don't understand what you mean by "doesn't jump to error". What are your definitions of "error" and "jump to"?

@augustjanse
Copy link
Author

Sorry, maybe I should have started with a screenshot.

When I run my tests (:Dispatch), I would like the error to be highlighted and scrolled down to in the quickfix window (not the code itself). This happens the first time:

On subsequent runs, however, it scrolls to the top instead:

Only when I focus on the quickfix window, it scrolls down to the highlighted error (identical to the first screenshot).

So, "error" is whatever Vim/Make determines is an error and "jump to" means scrolling down to and showing a line.

@tpope
Copy link
Owner

tpope commented Aug 20, 2019

Does closing the window with :cclose before running have any effect?

@augustjanse
Copy link
Author

No, it still did the second thing.

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