summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbheylin <3947+bheylin@users.noreply.github.com>2023-02-18 13:57:40 +0100
committerGitHub <noreply@github.com>2023-02-18 13:57:40 +0100
commitc8fdea88ec94fbb82466dc69d4a6df1e75bb352c (patch)
tree4d705d1aae98dca66ed449d79e20d07003a957a1
parentada08cc0057e21315cd44716f337d723b142a555 (diff)
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 <aram@poor.dev>
-rw-r--r--zellij-server/src/os_input_output.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs
index abcf24c87..6e11f5ed6 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,