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

Fix #2984: wrong tab selected after :quit #3170

Merged
merged 2 commits into from Dec 10, 2018
Merged

Conversation

insidewhy
Copy link
Contributor

What this PR does / why we need it:

Fixes #2984, the wrong tab is being selected after :q which is very annoying.

Which issue(s) this PR fixes

#2984

Special notes for your reviewer:

The previous code (that this PR deleted) seems to be there to work around a bug in VS Code, since the VS Code issue has been fixed the code now leads to this bug.

@insidewhy
Copy link
Contributor Author

I did a git lg -p on this file to find out why the code was introduced, unfortunately the commit message is a little cryptic: "71fc1d5b - make tab sequence feel right".

It seems VS Code behavior has changed since this commit and now leads to the sequence feeling right without needing any other behavior.

@insidewhy
Copy link
Contributor Author

insidewhy commented Oct 27, 2018

I debugged the code some more and I see that this.activeTextEditor.viewColumn never changes after running workbench.action.closeActiveEditor, no matter what tab I :q from. So the "select previous editor" logic that I'm deleting runs every single time, always leading you to the tab to the left of where you want to be.

@insidewhy
Copy link
Contributor Author

I was concerned the problem might be caused by the interaction between VS Code Vim and another plugin, but after disabling all other plugins the issue still manifests.

@insidewhy
Copy link
Contributor Author

insidewhy commented Oct 27, 2018

@rebornix You wrote the original code for this, could you let me know what the intention was here? After reading into ViewColumn it looks to me like it wasn't the right approach, but then I'm confused as to why the issue with selecting the wrong tab only started happening 3 months ago and not earlier.

@rebornix rebornix self-assigned this Oct 30, 2018
@insidewhy
Copy link
Contributor Author

@rebornix Is there any way I can help with this or you could help me get this merged? It's a pretty serious and visible bug to have been around for so long.

@gohar94
Copy link

gohar94 commented Dec 7, 2018

Any updates on this? It is EXTREMELY annoying to hit this countless times a day! :(

@rebornix
Copy link
Member

@ohjames sorry for late reply, the code change looks good to me.

@jpoon jpoon merged commit 04ba8b6 into VSCodeVim:master Dec 10, 2018
@insidewhy
Copy link
Contributor Author

Thanks!

@gohar94
Copy link

gohar94 commented Dec 11, 2018

Thanks, guys!

@insidewhy insidewhy deleted the jp/2984 branch December 12, 2018 16:50
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.

When closing a window with :q VS Code now selects the tab "before" the one you were previously on
4 participants