From c2e41082e4b2e0e1dba6a980a7f09ccaad88cbd0 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 11 Sep 2022 11:09:12 +0900 Subject: 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 --- helix-term/src/application.rs | 2 +- helix-term/src/commands/typed.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-term') diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index ec698321..7ee5b7f1 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -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)?; diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 674ce7a6..c22f8712 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -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)?; -- cgit v1.2.3-70-g09d2