on master help sign in
Show a message if no definition was found.
commitd4d5e88adec6e5996cdcf0a5d17e742796c6239d authorBlaž Hrastnik <blaz@mxxn.io> dateSat 8 May 2021, 15:39 (5 years ago) parent1be8b20
1 file changed+11−8
helix-term/src/commands.rs+11−8
helix-term/src/commands.rs+11−8
@@ -1268,7 +1268,9 @@ fn _goto(
12681268 [location] => {
12691269 jump_to(editor, location, offset_encoding, Action::Replace);
12701270 }
1271− [] => (), // maybe show user message that no definition was found?
1271+ [] => {
1272+ editor.set_error("No definition found.".to_string());
1273+ }
12721274 _locations => {
12731275 let mut picker = ui::Picker::new(
12741276 locations,
@@ -2039,14 +2041,15 @@ pub fn completion(cx: &mut Context) {
20392041 };
20402042
20412043 // TODO: if no completion, show some message or something
2042− if !items.is_empty() {
2043− use crate::compositor::AnyComponent;
2044− let size = compositor.size();
2045− let ui = compositor.find("hx::ui::editor::EditorView").unwrap();
2046− if let Some(ui) = ui.as_any_mut().downcast_mut::<ui::EditorView>() {
2047− ui.set_completion(items, offset_encoding, trigger_offset, size);
2048− };
2044+ if items.is_empty() {
2045+ return;
20492046 }
2047+ use crate::compositor::AnyComponent;
2048+ let size = compositor.size();
2049+ let ui = compositor.find("hx::ui::editor::EditorView").unwrap();
2050+ if let Some(ui) = ui.as_any_mut().downcast_mut::<ui::EditorView>() {
2051+ ui.set_completion(items, offset_encoding, trigger_offset, size);
2052+ };
20502053 },
20512054 );
20522055 // TODO: Server error: content modified