@@ -697,23 +697,27 @@ end
697697
698698-- @UX: Improve how the cursor and selection are restored on undo.
699699local function undoEdit (field )
700- if field .editHistoryIndex == 1 then return end
700+ if field .editHistoryIndex == 1 then return false end
701701
702702 finilizeHistoryGroup (field )
703703 applyHistoryState (field , - 1 )
704704
705705 field :resetBlinking ()
706706 field :scrollToCursor ()
707+
708+ return true
707709end
708710
709711local function redoEdit (field )
710- if field .editHistoryIndex == # field .editHistory then return end
712+ if field .editHistoryIndex == # field .editHistory then return false end
711713
712714 finilizeHistoryGroup (field )
713715 applyHistoryState (field , 1 )
714716
715717 field :resetBlinking ()
716718 field :scrollToCursor ()
719+
720+ return true
717721end
718722
719723
@@ -2097,17 +2101,13 @@ local function action_undo(field, isRepeat)
20972101 if not field .editingEnabled then return false , false end
20982102
20992103 -- @Robustness: Filter and/or font filter could have changed after the last edit.
2100- if field .type ~= " password" then undoEdit (field ) end
2101-
2102- return true , true
2104+ return true , (field .type ~= " password" and undoEdit (field ))
21032105end
21042106local function action_redo (field , isRepeat )
21052107 if not field .editingEnabled then return false , false end
21062108
21072109 -- @Robustness: Filter and/or font filter could have changed after the last edit.
2108- if field .type ~= " password" then redoEdit (field ) end
2109-
2110- return true , true
2110+ return true , (field .type ~= " password" and redoEdit (field ))
21112111end
21122112
21132113
0 commit comments