From c8fdea88ec94fbb82466dc69d4a6df1e75bb352c Mon Sep 17 00:00:00 2001 From: bheylin <3947+bheylin@users.noreply.github.com> Date: Sat, 18 Feb 2023 13:57:40 +0100 Subject: [PATCH] feat(editor): scrollback positioning with Helix (#2156) * Add Helix editor (`hx`) to editors that support prefix positions This is dependant on Helix accepting the PR: https://github.com/helix-editor/helix/pull/5945 * Add `helix` variant to accepted editors * Add branch for Helix file opening * style(code): add clarification comment * style(fmt): whitespace --------- Co-authored-by: Aram Drevekenin --- zellij-server/src/os_input_output.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index abcf24c8..6e11f5ed 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -303,9 +303,18 @@ fn spawn_terminal( { failover_cmd_args = Some(vec![file_to_open.clone()]); args.push(format!("+{}", line_number)); + args.push(file_to_open); + } else if command.ends_with("hx") || command.ends_with("helix") { + // at the time of writing, helix only supports this syntax + // and it might be a good idea to leave this here anyway + // to keep supporting old versions + args.push(format!("{}:{}", file_to_open, line_number)); + } else { + args.push(file_to_open); } + } else { + args.push(file_to_open); } - args.push(file_to_open); RunCommand { command, args,