on master help sign in
Remove the .txt suffix from tutor

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

commitc2e41082e4b2e0e1dba6a980a7f09ccaad88cbd0 authorBlaž Hrastnik <blaz@mxxn.io> dateSun 11 Sep 2022, 11:09 (4 years ago) parenta15420e
4 files changed+3−3
book/src/usage.md+1−1 helix-term/src/application.rs+1−1 helix-term/src/commands/typed.rs+1−1 runtime/tutor.txt → runtime/tutor
book/src/usage.md+1−1
@@ -2,7 +2,7 @@
22
33(Currently not fully documented, see the [keymappings](./keymap.md) list for more.)
44
5−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.
5+See [tutor](https://github.com/helix-editor/helix/blob/master/runtime/tutor) (accessible via `hx --tutor` or `:tutor`) for a vimtutor-like introduction.
66
77## Registers
88
helix-term/src/application.rs+1−1
@@ -157,7 +157,7 @@ impl Application {
157157 compositor.push(editor_view);
158158
159159 if args.load_tutor {
160− let path = helix_loader::runtime_dir().join("tutor.txt");
160+ let path = helix_loader::runtime_dir().join("tutor");
161161 editor.open(&path, Action::VerticalSplit)?;
162162 // Unset path to prevent accidentally saving to the original tutor file.
163163 doc_mut!(editor).set_path(None)?;
helix-term/src/commands/typed.rs+1−1
@@ -1147,7 +1147,7 @@ fn tutor(
11471147 return Ok(());
11481148 }
11491149
1150− let path = helix_loader::runtime_dir().join("tutor.txt");
1150+ let path = helix_loader::runtime_dir().join("tutor");
11511151 cx.editor.open(&path, Action::Replace)?;
11521152 // Unset path to prevent accidentally saving to the original tutor file.
11531153 doc_mut!(cx.editor).set_path(None)?;
runtime/tutor.txt → runtime/tutorrenamed

The content is the same.