aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorJoe2022-03-14 02:47:52 +0000
committerGitHub2022-03-14 02:47:52 +0000
commitc0dbd6dc3f147b46d4352ac78903a7a70741cfd9 (patch)
treedece1b71c36aa367d13959b0f483d66423150709 /helix-term/src/commands
parent85492e587cc27ba9783c8380683660a0f4423ff4 (diff)
Add horizontal and vertical split scratch buffers (#1763)
Make subcommand name more descriptive Fix vsplit completer Run cargo xtask docgen
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 3301d148..7866ff9d 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -771,6 +771,26 @@ fn hsplit(
Ok(())
}
+fn vsplit_new(
+ cx: &mut compositor::Context,
+ _args: &[Cow<str>],
+ _event: PromptEvent,
+) -> anyhow::Result<()> {
+ cx.editor.new_file(Action::VerticalSplit);
+
+ Ok(())
+}
+
+fn hsplit_new(
+ cx: &mut compositor::Context,
+ _args: &[Cow<str>],
+ _event: PromptEvent,
+) -> anyhow::Result<()> {
+ cx.editor.new_file(Action::HorizontalSplit);
+
+ Ok(())
+}
+
fn debug_eval(
cx: &mut compositor::Context,
args: &[Cow<str>],
@@ -1294,6 +1314,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
completer: Some(completers::filename),
},
TypableCommand {
+ name: "vsplit-new",
+ aliases: &["vnew"],
+ doc: "Open a scratch buffer in a vertical split.",
+ fun: vsplit_new,
+ completer: None,
+ },
+ TypableCommand {
name: "hsplit",
aliases: &["hs", "sp"],
doc: "Open the file in a horizontal split.",
@@ -1301,6 +1328,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
completer: Some(completers::filename),
},
TypableCommand {
+ name: "hsplit-new",
+ aliases: &["hnew"],
+ doc: "Open a scratch buffer in a horizontal split.",
+ fun: hsplit_new,
+ completer: None,
+ },
+ TypableCommand {
name: "tutor",
aliases: &[],
doc: "Open the tutorial.",