Add :tabonly and :only vim commands (#8337)
Release Notes: - Added [`:tabo[nly][!]`](https://neovim.io/doc/user/tabpage.html#%3Atabonly), closes all the tabs except the active one but in the current pane only, every other split pane remains unaffected. The version with the `!` force closes the tabs while the one without asks you to save or discard the changes. - Added [`:on[ly][!]`](https://neovim.io/doc/user/windows.html#%3Aonly), closes all the tabs *and* panes except the active one. The version with the `!` force closes the tabs while the one without asks you to save or discard the changes. Since Zed does not have different splits per tab like in Neovim `:only` works the same as it does in VscodeVim. --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
c31626717f
commit
a42b987929
3 changed files with 53 additions and 11 deletions
|
@ -201,6 +201,34 @@ pub fn command_interceptor(mut query: &str, cx: &AppContext) -> Option<CommandIn
|
|||
}
|
||||
.boxed_clone(),
|
||||
),
|
||||
"tabo" | "tabon" | "tabonl" | "tabonly" => (
|
||||
"tabonly",
|
||||
workspace::CloseInactiveItems {
|
||||
save_intent: Some(SaveIntent::Close),
|
||||
}
|
||||
.boxed_clone(),
|
||||
),
|
||||
"tabo!" | "tabon!" | "tabonl!" | "tabonly!" => (
|
||||
"tabonly!",
|
||||
workspace::CloseInactiveItems {
|
||||
save_intent: Some(SaveIntent::Skip),
|
||||
}
|
||||
.boxed_clone(),
|
||||
),
|
||||
"on" | "onl" | "only" => (
|
||||
"only",
|
||||
workspace::CloseInactiveTabsAndPanes {
|
||||
save_intent: Some(SaveIntent::Close),
|
||||
}
|
||||
.boxed_clone(),
|
||||
),
|
||||
"on!" | "onl!" | "only!" => (
|
||||
"only!",
|
||||
workspace::CloseInactiveTabsAndPanes {
|
||||
save_intent: Some(SaveIntent::Skip),
|
||||
}
|
||||
.boxed_clone(),
|
||||
),
|
||||
|
||||
// quickfix / loclist (merged together for now)
|
||||
"cl" | "cli" | "clis" | "clist" => (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue