@@ -64,8 +64,8 @@ impl Editor {
6464 EditCommand :: MoveToPosition { position, select } => {
6565 self . move_to_position ( * position, * select)
6666 }
67- EditCommand :: MoveLineUp { select } => self . move_up ( * select) ,
68- EditCommand :: MoveLineDown { select } => self . move_down ( * select) ,
67+ EditCommand :: MoveLineUp { select } => self . move_line_up ( * select) ,
68+ EditCommand :: MoveLineDown { select } => self . move_line_down ( * select) ,
6969 EditCommand :: MoveLeft { select } => self . move_left ( * select) ,
7070 EditCommand :: MoveRight { select } => self . move_right ( * select) ,
7171 EditCommand :: MoveWordLeft { select } => self . move_word_left ( * select) ,
@@ -254,12 +254,14 @@ impl Editor {
254254 self . line_buffer . set_insertion_point ( position)
255255 }
256256
257- pub ( crate ) fn move_line_up ( & mut self ) {
257+ pub ( crate ) fn move_line_up ( & mut self , select : bool ) {
258+ self . update_selection_anchor ( select) ;
258259 self . line_buffer . move_line_up ( ) ;
259260 self . update_undo_state ( UndoBehavior :: MoveCursor ) ;
260261 }
261262
262- pub ( crate ) fn move_line_down ( & mut self ) {
263+ pub ( crate ) fn move_line_down ( & mut self , select : bool ) {
264+ self . update_selection_anchor ( select) ;
263265 self . line_buffer . move_line_down ( ) ;
264266 self . update_undo_state ( UndoBehavior :: MoveCursor ) ;
265267 }
@@ -621,16 +623,6 @@ impl Editor {
621623 self . line_buffer . insert_str ( string) ;
622624 }
623625
624- fn move_up ( & mut self , select : bool ) {
625- self . update_selection_anchor ( select) ;
626- self . line_buffer . move_line_up ( ) ;
627- }
628-
629- fn move_down ( & mut self , select : bool ) {
630- self . update_selection_anchor ( select) ;
631- self . line_buffer . move_line_down ( ) ;
632- }
633-
634626 fn move_left ( & mut self , select : bool ) {
635627 self . update_selection_anchor ( select) ;
636628 self . line_buffer . move_left ( ) ;
0 commit comments