@@ -117,20 +117,18 @@ pub fn move_next_word_end(view: &mut View, count: usize) {
117117 view.state.selection = Selection::single(pos, pos);
118118}
119119
120−pub fn move_file_start(view: &mut View, count: usize) {
120+pub fn move_file_start(view: &mut View, _count: usize) {
121121 // TODO: use a transaction
122− view.state.selection = view
123− .state
124− .move_selection(Direction::Backward, Granularity::Line, count);
122+ view.state.selection = Selection::single(0, 0);
125123
126124 view.state.mode = Mode::Normal;
127125}
128126
129−pub fn move_file_end(view: &mut View, count: usize) {
127+pub fn move_file_end(view: &mut View, _count: usize) {
130128 // TODO: use a transaction
131− view.state.selection = view
132− .state
133− .move_selection(Direction::Forward, Granularity::Line, count);
129+ let text = &view.state.doc;
130+ let last_line = text.char_to_line(text.len_lines().checked_sub(1).unwrap());
131+ view.state.selection = Selection::single(last_line, last_line);
134132
135133 view.state.mode = Mode::Normal;
136134}