on master help sign in
Show a message if no definition was found.
d4d5e88Blaž Hrastnik
helix-term/src/commands.rs+11−8
@@ -1268,7 +1268,9 @@ fn _goto(
1268 [location] => {
1268 [location] => {
1269 jump_to(editor, location, offset_encoding, Action::Replace);
1269 jump_to(editor, location, offset_encoding, Action::Replace);
1270 }
1270 }
1271− [] => (), // maybe show user message that no definition was found?
1271+ [] => {
1272+ editor.set_error("No definition found.".to_string());
1273+ }
1272 _locations => {
1274 _locations => {
1273 let mut picker = ui::Picker::new(
1275 let mut picker = ui::Picker::new(
1274 locations,
1276 locations,
@@ -2039,14 +2041,15 @@ pub fn completion(cx: &mut Context) {
2039 };
2041 };
2040
2042
2041 // TODO: if no completion, show some message or something
2043 // TODO: if no completion, show some message or something
2042− if !items.is_empty() {
2044+ if items.is_empty() {
2043− use crate::compositor::AnyComponent;
2045+ return;
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− };
2049 }
2046 }
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+ };
2050 },
2053 },
2051 );
2054 );
2052 // TODO: Server error: content modified
2055 // TODO: Server error: content modified