diff options
author | Shafkath Shuhan | 2021-06-23 06:03:34 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-23 06:40:27 +0000 |
commit | fd98e743e888e8fbddf4987213afbb19dd148fd7 (patch) | |
tree | 084b7ccccb5b9ddac506c157a57fc99747ffd0f7 /helix-term/src/commands.rs | |
parent | 9706f1121de673950d8e0472062a32f18d527ad2 (diff) |
Handle non-UTF8 files
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 8c76e869..cf583953 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -239,7 +239,6 @@ impl Command { join_selections, keep_selections, keep_primary_selection, - save, completion, hover, toggle_comments, @@ -1080,7 +1079,7 @@ mod cmd { if autofmt { doc.format(view.id); // TODO: merge into save } - helix_lsp::block_on(doc.save()); + helix_lsp::block_on(tokio::spawn(doc.save())); Ok(()) } @@ -1256,7 +1255,7 @@ mod cmd { errors.push_str("cannot write a buffer without a filename\n"); continue; } - helix_lsp::block_on(doc.save()); + helix_lsp::block_on(tokio::spawn(doc.save())); } editor.set_error(errors); @@ -2950,15 +2949,6 @@ fn keep_primary_selection(cx: &mut Context) { doc.set_selection(view.id, selection); } -// - -fn save(cx: &mut Context) { - // Spawns an async task to actually do the saving. This way we prevent blocking. - - // TODO: handle save errors somehow? - tokio::spawn(doc_mut!(cx.editor).save()); -} - fn completion(cx: &mut Context) { // trigger on trigger char, or if user calls it // (or on word char typing??) |