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

Implement tabc[lose] ex command #244

Merged
merged 1 commit into from Jul 16, 2020
Merged

Conversation

rieonke
Copy link
Contributor

@rieonke rieonke commented Jul 2, 2020

Hello,
This PR implemented the tabc[lose] ex command to close a specific tab.
https://youtrack.jetbrains.com/issue/VIM-2068


🍺 usages:

:tabc[lose]   Close current tab page
:tabc[lose]{count}  Close tab page {count}. just like the classic vim:
         :tabclose -2    " close the two previous tab page
         :tabclose +     " close the next tab page
         :tabclose 3     " close the third tab page
         :tabclose $     " close the last tab page

🔔 notices:

  • If there is only one tab page on the current active tabbed pane, then this tab will be closed, which is different from the classic vim.
  • If the {count} parameter is out of range, then the nearest head or tail pane will be closed.
  • If current tab has been closed, the focus state will be transfered to next tab, otherwise the current tab remains focus state

❓ questions:
How can I write a test for UI related functions? I can't get the EditorWindow object in test case, it's always null.

Thanks!

@AlexPl292
Copy link
Member

Great, thank you for the contribution! Unfortunatelly, UI tests is a complicated question for IdeaVim (and for IJ, I guess). I'll try to find a way to test it and notify you if I find something.

@AlexPl292 AlexPl292 merged commit 008edc7 into JetBrains:master Jul 16, 2020
@AlexPl292
Copy link
Member

Also, I've updated the syntax a bit. If you're interested: 26aa753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants