Skip to content

Commit

Permalink
Remove the .txt suffix from tutor
Browse files Browse the repository at this point in the history
The tutor file is loaded as .txt which can potentially spawn a
language server. Then the path is unset, but the LS remains active.
This can cause panics since updates are now submitted for a doc
with no path.

As a quick workaround we remove the extension which should avoid
detection.

Fixes #3730
  • Loading branch information
archseer committed Sep 11, 2022
1 parent a15420e commit c2e4108
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion book/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(Currently not fully documented, see the [keymappings](./keymap.md) list for more.)

See [tutor.txt](https://github.com/helix-editor/helix/blob/master/runtime/tutor.txt) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction.
See [tutor](https://github.com/helix-editor/helix/blob/master/runtime/tutor) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction.

## Registers

Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Application {
compositor.push(editor_view);

if args.load_tutor {
let path = helix_loader::runtime_dir().join("tutor.txt");
let path = helix_loader::runtime_dir().join("tutor");
editor.open(&path, Action::VerticalSplit)?;
// Unset path to prevent accidentally saving to the original tutor file.
doc_mut!(editor).set_path(None)?;
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ fn tutor(
return Ok(());
}

let path = helix_loader::runtime_dir().join("tutor.txt");
let path = helix_loader::runtime_dir().join("tutor");
cx.editor.open(&path, Action::Replace)?;
// Unset path to prevent accidentally saving to the original tutor file.
doc_mut!(cx.editor).set_path(None)?;
Expand Down
File renamed without changes.

0 comments on commit c2e4108

Please sign in to comment.