|
|
@ -1659,6 +1659,24 @@ fn tab_new(
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn tab_rename(
|
|
|
|
|
|
|
|
cx: &mut compositor::Context,
|
|
|
|
|
|
|
|
args: &[Cow<str>],
|
|
|
|
|
|
|
|
event: PromptEvent,
|
|
|
|
|
|
|
|
) -> anyhow::Result<()> {
|
|
|
|
|
|
|
|
if event != PromptEvent::Validate {
|
|
|
|
|
|
|
|
return Ok(());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.len() != 1 {
|
|
|
|
|
|
|
|
anyhow::bail!("Bad arguments. Usage: `:tab-rename name`");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cx.editor.tabs.curr_tab_mut().name = args[0].to_string();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn vsplit(
|
|
|
|
fn vsplit(
|
|
|
|
cx: &mut compositor::Context,
|
|
|
|
cx: &mut compositor::Context,
|
|
|
|
args: &[Cow<str>],
|
|
|
|
args: &[Cow<str>],
|
|
|
@ -2975,6 +2993,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
|
|
|
|
fun: tab_previous,
|
|
|
|
fun: tab_previous,
|
|
|
|
signature: CommandSignature::none(),
|
|
|
|
signature: CommandSignature::none(),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
TypableCommand {
|
|
|
|
|
|
|
|
name: "tab-rename",
|
|
|
|
|
|
|
|
aliases: &[],
|
|
|
|
|
|
|
|
doc: "Change the name of the current tab.",
|
|
|
|
|
|
|
|
fun: tab_rename,
|
|
|
|
|
|
|
|
signature: CommandSignature::none(),
|
|
|
|
|
|
|
|
},
|
|
|
|
TypableCommand {
|
|
|
|
TypableCommand {
|
|
|
|
name: "vsplit",
|
|
|
|
name: "vsplit",
|
|
|
|
aliases: &["vs"],
|
|
|
|
aliases: &["vs"],
|
|
|
|