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>
This commit is contained in:
bheylin 2023-02-18 13:57:40 +01:00 committed by GitHub
parent ada08cc005
commit c8fdea88ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -303,9 +303,18 @@ fn spawn_terminal(
{ {
failover_cmd_args = Some(vec![file_to_open.clone()]); failover_cmd_args = Some(vec![file_to_open.clone()]);
args.push(format!("+{}", line_number)); 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 { RunCommand {
command, command,
args, args,