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

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

[nongnu] elpa/multiple-cursors 0512561 076/434: Skip lines in rectangula


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 0512561 076/434: Skip lines in rectangular-region-mode that are too short for the rectangle.
Date: Sat, 7 Aug 2021 09:19:58 -0400 (EDT)

branch: elpa/multiple-cursors
commit 05125618aa255f5e5e5afee1e0f67f7189840c65
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>

    Skip lines in rectangular-region-mode that are too short for the rectangle.
---
 rectangular-region-mode.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/rectangular-region-mode.el b/rectangular-region-mode.el
index 8226015..16b012b 100644
--- a/rectangular-region-mode.el
+++ b/rectangular-region-mode.el
@@ -39,17 +39,18 @@
          (left-column (if (< point-column anchor-column) point-column 
anchor-column))
          (right-column (if (> point-column anchor-column) point-column 
anchor-column))
          (navigation-func (if (< point-line anchor-line) 'next-line 
'previous-line)))
-    (move-to-column anchor-column t)
+    (move-to-column anchor-column)
     (set-mark (point))
-    (move-to-column point-column t)
+    (move-to-column point-column)
     (mc/save-excursion
      (while (not (= anchor-line (line-number-at-pos)))
        (funcall navigation-func)
-       (move-to-column right-column t)
-       (move-to-column anchor-column t)
-       (set-mark (point))
-       (move-to-column point-column t)
-       (mc/create-fake-cursor-at-point)))))
+       (move-to-column anchor-column)
+       (when (= anchor-column (current-column))
+         (set-mark (point))
+         (move-to-column point-column)
+         (when (= point-column (current-column))
+           (mc/create-fake-cursor-at-point)))))))
 
 (defun rrm/switch-to-multiple-cursors (&rest forms)
   (interactive)



reply via email to

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