emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 241/352: Korjataan wcheck-jump-backward -bugi


From: Stefan Monnier
Subject: [elpa] 241/352: Korjataan wcheck-jump-backward -bugi
Date: Mon, 07 Jul 2014 14:04:34 +0000

monnier pushed a commit to branch master
in repository elpa.

commit 4764312724388f43bf9eee76f29f8ca714b27e36
Author: Teemu Likonen <address@hidden>
Date:   Sat May 28 10:37:35 2011 +0000

    Korjataan wcheck-jump-backward -bugi
    
    Hyppy taaksepäin puskurin alusta alkavaan maalattuun tekstiin ei
    toiminut. Vika oli funktiossa wcheck-overlay-previous.
---
 wcheck-mode.el |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/wcheck-mode.el b/wcheck-mode.el
index aa9d0de..ed4384c 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -1411,26 +1411,30 @@ text."
 
 
 (defun wcheck-overlay-next (start bound)
-  (catch 'overlay
-    (dolist (ol (overlays-at start))
-      (when (overlay-get ol 'wcheck-mode)
-        (throw 'overlay ol)))
-    (let ((pos start))
-      (while (and (setq pos (next-overlay-change pos))
-                  (< pos (min bound (point-max))))
-        (dolist (ol (overlays-at pos))
-          (when (overlay-get ol 'wcheck-mode)
-            (throw 'overlay ol)))))))
+  (unless (>= start (point-max))
+    (catch 'overlay
+      (dolist (ol (overlays-at start))
+        (when (overlay-get ol 'wcheck-mode)
+          (throw 'overlay ol)))
+      (let ((pos start))
+        (while (and (setq pos (next-overlay-change pos))
+                    (< pos (min bound (point-max))))
+          (dolist (ol (overlays-at pos))
+            (when (overlay-get ol 'wcheck-mode)
+              (throw 'overlay ol))))))))
 
 
 (defun wcheck-overlay-previous (start bound)
-  (catch 'overlay
-    (let ((pos start))
-      (while (and (setq pos (previous-overlay-change pos))
-                  (> pos (max bound (point-min))))
-        (dolist (ol (overlays-at pos))
-          (when (overlay-get ol 'wcheck-mode)
-            (throw 'overlay ol)))))))
+  (unless (<= start (point-min))
+    (catch 'overlay
+      (let ((pos start))
+        (while t
+          (setq pos (previous-overlay-change pos))
+          (dolist (ol (overlays-at pos))
+            (when (overlay-get ol 'wcheck-mode)
+              (throw 'overlay ol)))
+          (when (<= pos (max bound (point-min)))
+            (throw 'overlay nil)))))))
 
 
 (defun wcheck-line-start-at (pos)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]