File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ impl Editor {
194194 let deleted_char = self . edit_stack . current ( ) . grapheme_left ( ) . chars ( ) . next ( ) ;
195195 UndoBehavior :: Backspace ( deleted_char)
196196 }
197- ( _, EditType :: UndoRedo ) => UndoBehavior :: UndoRedo ,
197+ ( _, EditType :: UndoRedo | EditType :: NoOp ) => UndoBehavior :: NoOp ,
198198 ( _, _) => UndoBehavior :: CreateUndoPoint ,
199199 } ;
200200
@@ -307,8 +307,8 @@ impl Editor {
307307 }
308308
309309 pub ( crate ) fn update_undo_state ( & mut self , undo_behavior : UndoBehavior ) {
310- if matches ! ( undo_behavior, UndoBehavior :: UndoRedo ) {
311- self . last_undo_behavior = UndoBehavior :: UndoRedo ;
310+ if matches ! ( undo_behavior, UndoBehavior :: NoOp ) {
311+ self . last_undo_behavior = UndoBehavior :: NoOp ;
312312 return ;
313313 }
314314 if !undo_behavior. create_undo_point_after ( & self . last_undo_behavior ) {
Original file line number Diff line number Diff line change @@ -615,9 +615,9 @@ impl EditCommand {
615615 #[ cfg( feature = "system_clipboard" ) ]
616616 EditCommand :: CopySelectionSystem => EditType :: NoOp ,
617617 EditCommand :: CutInsidePair { .. } => EditType :: EditText ,
618- EditCommand :: CopyInsidePair { .. } => EditType :: EditText ,
618+ EditCommand :: CopyInsidePair { .. } => EditType :: NoOp ,
619619 EditCommand :: CutAroundPair { .. } => EditType :: EditText ,
620- EditCommand :: CopyAroundPair { .. } => EditType :: EditText ,
620+ EditCommand :: CopyAroundPair { .. } => EditType :: NoOp ,
621621 EditCommand :: CutTextObject { .. } => EditType :: EditText ,
622622 EditCommand :: CopyTextObject { .. } => EditType :: NoOp ,
623623 EditCommand :: CopyFromStart
@@ -674,8 +674,8 @@ pub enum UndoBehavior {
674674 /// Catch-all for actions that should always form a unique undo point and never be
675675 /// grouped with later edits
676676 CreateUndoPoint ,
677- /// Undo/Redo actions shouldn't be reflected on the edit stack
678- UndoRedo ,
677+ /// For actions that shouldn't be reflected on the edit stack e.g. Undo/Redo
678+ NoOp ,
679679}
680680
681681impl UndoBehavior {
You can’t perform that action at this time.
0 commit comments