diff options
author | Blaž Hrastnik | 2021-05-08 06:39:42 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-08 06:39:42 +0000 |
commit | d4d5e88adec6e5996cdcf0a5d17e742796c6239d (patch) | |
tree | c6b622cd49def10cc153f30feee66521d61b8bd7 /helix-term/src/commands.rs | |
parent | 1be8b2005d41dc5b396e2b46fbc83dc98c3e0416 (diff) |
Show a message if no definition was found.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r-- | helix-term/src/commands.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 6fb1c6a9..718d321a 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1268,7 +1268,9 @@ fn _goto( [location] => { jump_to(editor, location, offset_encoding, Action::Replace); } - [] => (), // maybe show user message that no definition was found? + [] => { + editor.set_error("No definition found.".to_string()); + } _locations => { let mut picker = ui::Picker::new( locations, @@ -2039,14 +2041,15 @@ pub fn completion(cx: &mut Context) { }; // TODO: if no completion, show some message or something - if !items.is_empty() { - use crate::compositor::AnyComponent; - let size = compositor.size(); - let ui = compositor.find("hx::ui::editor::EditorView").unwrap(); - if let Some(ui) = ui.as_any_mut().downcast_mut::<ui::EditorView>() { - ui.set_completion(items, offset_encoding, trigger_offset, size); - }; + if items.is_empty() { + return; } + use crate::compositor::AnyComponent; + let size = compositor.size(); + let ui = compositor.find("hx::ui::editor::EditorView").unwrap(); + if let Some(ui) = ui.as_any_mut().downcast_mut::<ui::EditorView>() { + ui.set_completion(items, offset_encoding, trigger_offset, size); + }; }, ); // TODO: Server error: content modified |