branch: externals/vlf
commit ffac6972ed8abaf903571c149e4891b1425ef764
Author: Andrey Kotlarski <[email protected]>
Commit: Andrey Kotlarski <[email protected]>
Keep undo list after occur or unsuccessful line search.
---
vlf-occur.el | 4 ++--
vlf-search.el | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vlf-occur.el b/vlf-occur.el
index 10f8d6a..e14e4b5 100644
--- a/vlf-occur.el
+++ b/vlf-occur.el
@@ -136,9 +136,9 @@ Prematurely ending indexing will still show what's found so
far."
(let ((start-pos vlf-start-pos)
(end-pos vlf-end-pos)
(pos (point)))
- (vlf-beginning-of-file)
- (goto-char (point-min))
(vlf-with-undo-disabled
+ (vlf-beginning-of-file)
+ (goto-char (point-min))
(unwind-protect (vlf-build-occur regexp (current-buffer))
(vlf-move-to-chunk start-pos end-pos)
(goto-char pos))))))
diff --git a/vlf-search.el b/vlf-search.el
index 422fbda..ba76237 100644
--- a/vlf-search.el
+++ b/vlf-search.el
@@ -241,7 +241,8 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(setq success (vlf-re-search "[\n\C-m]" n t 0))))))
(if font-lock (font-lock-mode 1))
(unless success
- (vlf-move-to-chunk-2 start-pos end-pos)
+ (vlf-with-undo-disabled
+ (vlf-move-to-chunk-2 start-pos end-pos))
(goto-char pos)
(message "Unable to find line")))))