@@ -1270,9 +1270,32 @@ pub fn goto_mode(cx: &mut Context) {
1270 'g' => move_file_start(cx),
1270 'g' => move_file_start(cx),
1271 'e' => move_file_end(cx),
1271 'e' => move_file_end(cx),
1272 'd' => goto_definition(cx),
1272 'd' => goto_definition(cx),
1273− 't' => goto_type_definition(cx),
1273+ 'y' => goto_type_definition(cx),
1274 'r' => goto_reference(cx),
1274 'r' => goto_reference(cx),
1275 'i' => goto_implementation(cx),
1275 'i' => goto_implementation(cx),
1277+ 't' | 'm' | 'b' => {
1278+ let (view, doc) = cx.current();
1280+ let pos = doc.selection(view.id).cursor();
1281+ let line = doc.text().char_to_line(pos);
1283+ let scrolloff = PADDING.min(view.area.height as usize / 2); // TODO: user pref
1285+ let last_line = view.last_line(doc);
1287+ let line = match ch {
1288+ 't' => (view.first_line + scrolloff),
1289+ 'm' => (view.first_line + (view.area.height as usize / 2)),
1290+ 'b' => last_line.saturating_sub(scrolloff),
1291+ _ => unreachable!(),
1293+ .min(last_line.saturating_sub(scrolloff));
1295+ let pos = doc.text().line_to_char(line);
1297+ doc.set_selection(view.id, Selection::point(pos));
1276 _ => (),
1299 _ => (),