File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ impl Editor {
190190 let deleted_char = self . edit_stack . current ( ) . grapheme_left ( ) . chars ( ) . next ( ) ;
191191 UndoBehavior :: Backspace ( deleted_char)
192192 }
193- ( _, EditType :: UndoRedo ) => UndoBehavior :: UndoRedo ,
193+ ( _, EditType :: UndoRedo | EditType :: NoOp ) => UndoBehavior :: NoOp ,
194194 ( _, _) => UndoBehavior :: CreateUndoPoint ,
195195 } ;
196196
@@ -303,8 +303,8 @@ impl Editor {
303303 }
304304
305305 pub ( crate ) fn update_undo_state ( & mut self , undo_behavior : UndoBehavior ) {
306- if matches ! ( undo_behavior, UndoBehavior :: UndoRedo ) {
307- self . last_undo_behavior = UndoBehavior :: UndoRedo ;
306+ if matches ! ( undo_behavior, UndoBehavior :: NoOp ) {
307+ self . last_undo_behavior = UndoBehavior :: NoOp ;
308308 return ;
309309 }
310310 if !undo_behavior. create_undo_point_after ( & self . last_undo_behavior ) {
Original file line number Diff line number Diff line change @@ -547,7 +547,7 @@ impl EditCommand {
547547 #[ cfg( feature = "system_clipboard" ) ]
548548 EditCommand :: CopySelectionSystem => EditType :: NoOp ,
549549 EditCommand :: CutInside { .. } => EditType :: EditText ,
550- EditCommand :: YankInside { .. } => EditType :: EditText ,
550+ EditCommand :: YankInside { .. } => EditType :: NoOp ,
551551 EditCommand :: CopyFromStart
552552 | EditCommand :: CopyFromLineStart
553553 | EditCommand :: CopyToEnd
@@ -602,8 +602,8 @@ pub enum UndoBehavior {
602602 /// Catch-all for actions that should always form a unique undo point and never be
603603 /// grouped with later edits
604604 CreateUndoPoint ,
605- /// Undo/Redo actions shouldn't be reflected on the edit stack
606- UndoRedo ,
605+ /// For actions that shouldn't be reflected on the edit stack e.g. Undo/Redo
606+ NoOp ,
607607}
608608
609609impl UndoBehavior {
You can’t perform that action at this time.
0 commit comments