From b4af35175836490fd2ccfb526485f5dcedae4267 Mon Sep 17 00:00:00 2001 From: Brian Heylin <3947+bheylin@users.noreply.github.com> Date: Sun, 12 Feb 2023 11:45:35 +0100 Subject: [PATCH 1/5] 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 --- zellij-server/src/os_input_output.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 9c214b7052..6f1ed2bf67 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -300,6 +300,7 @@ fn spawn_terminal( || command.ends_with("emacs") || command.ends_with("nano") || command.ends_with("kak") + || command.ends_with("hx") { failover_cmd_args = Some(vec![file_to_open.clone()]); args.push(format!("+{}", line_number)); From 9acf464e566643863f13fcc294db032349395888 Mon Sep 17 00:00:00 2001 From: Brian Heylin <3947+bheylin@users.noreply.github.com> Date: Sun, 12 Feb 2023 14:14:21 +0100 Subject: [PATCH 2/5] Add `helix` variant to accepted editors --- zellij-server/src/os_input_output.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 6f1ed2bf67..ccd0f855c7 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -301,6 +301,7 @@ fn spawn_terminal( || command.ends_with("nano") || command.ends_with("kak") || command.ends_with("hx") + || command.ends_with("helix") { failover_cmd_args = Some(vec![file_to_open.clone()]); args.push(format!("+{}", line_number)); From b5f9c37ccb23103df82d45514605f8e3a40bb7ad Mon Sep 17 00:00:00 2001 From: Brian Heylin <3947+bheylin@users.noreply.github.com> Date: Tue, 14 Feb 2023 15:38:30 +0100 Subject: [PATCH 3/5] Add branch for Helix file opening --- zellij-server/src/os_input_output.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index ccd0f855c7..d6755fc6c1 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -300,14 +300,18 @@ fn spawn_terminal( || command.ends_with("emacs") || command.ends_with("nano") || command.ends_with("kak") - || command.ends_with("hx") - || command.ends_with("helix") { 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") { + 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, From 6af43cdc26f0cf841b03938625b5407c5c36af81 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Fri, 17 Feb 2023 12:28:02 +0100 Subject: [PATCH 4/5] style(code): add clarification comment --- zellij-server/src/os_input_output.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 1c2f39e977..288c77a564 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -305,6 +305,9 @@ fn spawn_terminal( 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); From 5951551f7b129e053b23afef5d4cb0198ae50bba Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Sat, 18 Feb 2023 11:12:42 +0100 Subject: [PATCH 5/5] style(fmt): whitespace --- zellij-server/src/os_input_output.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 288c77a564..3e6ba420a9 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -306,7 +306,7 @@ fn spawn_terminal( 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 + // 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 {