@@ -1032,7 +1032,24 @@ pub fn normal_mode(cx: &mut Context) {
1034pub fn goto_mode(cx: &mut Context) {
1034pub fn goto_mode(cx: &mut Context) {
1035− cx.doc().mode = Mode::Goto;
1035+ cx.on_next_key(move |cx, event| {
1037+ code: KeyCode::Char(ch),
1041+ // TODO: temporarily show GOTO in the mode list
1043+ 'g' => move_file_start(cx),
1044+ 'e' => move_file_end(cx),
1045+ 'd' => goto_definition(cx),
1046+ 't' => goto_type_definition(cx),
1047+ 'r' => goto_reference(cx),
1048+ 'i' => goto_implementation(cx),
1038pub fn select_mode(cx: &mut Context) {
1055pub fn select_mode(cx: &mut Context) {
@@ -1043,7 +1060,7 @@ pub fn exit_select_mode(cx: &mut Context) {
1043 cx.doc().mode = Mode::Normal;
1060 cx.doc().mode = Mode::Normal;
1046−fn goto(cx: &mut Context, locations: Vec<lsp::Location>) {
1063+fn _goto(cx: &mut Context, locations: Vec<lsp::Location>) {
1047 use helix_view::editor::Action;
1064 use helix_view::editor::Action;
1048 cx.doc().mode = Mode::Normal;
1065 cx.doc().mode = Mode::Normal;
@@ -1093,7 +1110,7 @@ pub fn goto_definition(cx: &mut Context) {
1093 // TODO: handle fails
1110 // TODO: handle fails
1094 let res =
1111 let res =
1095 smol::block_on(language_server.goto_definition(doc.identifier(), pos)).unwrap_or_default();
1112 smol::block_on(language_server.goto_definition(doc.identifier(), pos)).unwrap_or_default();
1096− goto(cx, res);
1113+ _goto(cx, res);
1099pub fn goto_type_definition(cx: &mut Context) {
1116pub fn goto_type_definition(cx: &mut Context) {
@@ -1109,7 +1126,7 @@ pub fn goto_type_definition(cx: &mut Context) {
1109 // TODO: handle fails
1126 // TODO: handle fails
1110 let res = smol::block_on(language_server.goto_type_definition(doc.identifier(), pos))
1127 let res = smol::block_on(language_server.goto_type_definition(doc.identifier(), pos))
1111 .unwrap_or_default();
1128 .unwrap_or_default();
1112− goto(cx, res);
1129+ _goto(cx, res);
1115pub fn goto_implementation(cx: &mut Context) {
1132pub fn goto_implementation(cx: &mut Context) {
@@ -1125,7 +1142,7 @@ pub fn goto_implementation(cx: &mut Context) {
1125 // TODO: handle fails
1142 // TODO: handle fails
1126 let res = smol::block_on(language_server.goto_implementation(doc.identifier(), pos))
1143 let res = smol::block_on(language_server.goto_implementation(doc.identifier(), pos))
1127 .unwrap_or_default();
1144 .unwrap_or_default();
1128− goto(cx, res);
1145+ _goto(cx, res);
1131pub fn goto_reference(cx: &mut Context) {
1148pub fn goto_reference(cx: &mut Context) {
@@ -1141,7 +1158,7 @@ pub fn goto_reference(cx: &mut Context) {
1141 // TODO: handle fails
1158 // TODO: handle fails
1142 let res =
1159 let res =
1143 smol::block_on(language_server.goto_reference(doc.identifier(), pos)).unwrap_or_default();
1160 smol::block_on(language_server.goto_reference(doc.identifier(), pos)).unwrap_or_default();
1144− goto(cx, res);
1161+ _goto(cx, res);
1147pub fn signature_help(cx: &mut Context) {
1164pub fn signature_help(cx: &mut Context) {