@@ -1276,17 +1276,19 @@ pub fn goto_mode(cx: &mut Context) {
12761276 } = event
12771277 {
12781278 // TODO: temporarily show GOTO in the mode list
1279− match ch {
1280− 'g' => move_file_start(cx),
1281− 'e' => move_file_end(cx),
1282− 'h' => move_line_start(cx),
1283− 'l' => move_line_end(cx),
1284− 'd' => goto_definition(cx),
1285− 'y' => goto_type_definition(cx),
1286− 'r' => goto_reference(cx),
1287− 'i' => goto_implementation(cx),
1288−
1289− 't' | 'm' | 'b' => {
1279+ match (cx.doc().mode, ch) {
1280+ (_, 'g') => move_file_start(cx),
1281+ (_, 'e') => move_file_end(cx),
1282+ (Mode::Normal, 'h') => move_line_start(cx),
1283+ (Mode::Normal, 'l') => move_line_end(cx),
1284+ (Mode::Select, 'h') => extend_line_start(cx),
1285+ (Mode::Select, 'l') => extend_line_end(cx),
1286+ (_, 'd') => goto_definition(cx),
1287+ (_, 'y') => goto_type_definition(cx),
1288+ (_, 'r') => goto_reference(cx),
1289+ (_, 'i') => goto_implementation(cx),
1290+
1291+ (_, 't') | (_, 'm') | (_, 'b') => {
12901292 let (view, doc) = cx.current();
12911293
12921294 let pos = doc.selection(view.id).cursor();