[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/undo-fu 49cca61343 56/82: Fix unconstrained redo trapping
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/undo-fu 49cca61343 56/82: Fix unconstrained redo trapping the user at the end of the chain |
Date: |
Thu, 7 Jul 2022 12:04:53 -0400 (EDT) |
branch: elpa/undo-fu
commit 49cca61343e5fc80347a7b1f7d8692a49752575d
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Fix unconstrained redo trapping the user at the end of the chain
Add a special check for this, allowing you to undo out of this state.
---
changelog.rst | 2 ++
undo-fu.el | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/changelog.rst b/changelog.rst
index 57787c5684..9ed97ea73b 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -5,6 +5,8 @@ Change Log
- In development
+ - Fix continual redo in unconstrained mode trapping the user in a state
+ where neither undo or redo can be performed.
- Fix undo checkpoint initialization when running for the first with
existing undo data.
This could happen when running undo immediately upon loading a file with
undo data from ``undo-fu-session``.
- Undo in *unconstrained* mode no longer uses ``undo-only``,
diff --git a/undo-fu.el b/undo-fu.el
index ac70a1ef67..120fd1b39d 100644
--- a/undo-fu.el
+++ b/undo-fu.el
@@ -353,6 +353,7 @@ Optional argument ARG the number of steps to undo."
(let*
( ;; Assign for convenience.
(was-undo-or-redo (undo-fu--was-undo-or-redo))
+ (was-redo (and was-undo-or-redo undo-fu--was-redo))
(undo-fu-quit-command
(if undo-fu-ignore-keyboard-quit
'undo-fu-disable-checkpoint
@@ -399,6 +400,15 @@ Optional argument ARG the number of steps to undo."
(steps (or arg 1))
(last-command
(cond
+ ;; Special case, to avoid being locked out of the undo-redo chain.
+ ;; Without this, continuously redoing will end up in a state where
undo & redo fails.
+ ;;
+ ;; Detect this case and break the chain. Only do this when
previously redoing
+ ;; otherwise undo will reverse immediately once it reaches the
beginning,
+ ;; which we don't want even when unconstrained,
+ ;; as we don't want to present the undo chain as infinite in
either direction.
+ ((and was-redo (null undo-fu--respect) (eq t pending-undo-list))
+ 'ignore)
(was-undo-or-redo
;; Checked by the undo function.
'undo)
- [nongnu] elpa/undo-fu 32674fc7b0 47/82: Release 0.3, (continued)
- [nongnu] elpa/undo-fu 32674fc7b0 47/82: Release 0.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu c0806c1903 60/82: Update changelog, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu aae7ec9784 49/82: Cleanup: use mapc for multiple calls to evil-declare-not-repeat, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f9c39c248c 81/82: readme: update to use evil-modes undo-fu support, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 97e7f4f6e0 82/82: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu fa245fd3d0 01/82: Initial functionality., ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 8daa0b5c46 05/82: Correct docstrings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 792d27b8a1 16/82: Lower version requirement to 24.3, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 1ecbe826ae 20/82: Fix undo-fu-only-redo-all counting incorrectly, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 0c34b6747e 52/82: Cleanup: replace cl-letf with macro that temporarily sets advice, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 49cca61343 56/82: Fix unconstrained redo trapping the user at the end of the chain,
ELPA Syncer <=
- [nongnu] elpa/undo-fu 25e25ec4df 48/82: Cleanup: typos, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu f4db4c9b98 62/82: Update readme, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e81c8da441 73/82: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu d3d50ad00d 67/82: Cleanup: quiet docstring width warning, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu ab8bc10e42 72/82: Cleanup: minor wording changes, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 7430fa58f1 75/82: Fix unconstrained undo when the user has undo-no-redo enabled, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9159f46b70 78/82: Cleanup: prefer `cond` to `if`, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 756a4846b3 06/82: Remove redundant error handling case, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu e49ee5bdc3 10/82: Show unconstrained suffix for unconstrained undo/redo, ELPA Syncer, 2022/07/07
- [nongnu] elpa/undo-fu 9bf729c727 09/82: Support pressing C-g before undo, ELPA Syncer, 2022/07/07