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

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

[elpa] externals/speedrect c47e5e4e7b 43/90: move commands: use rectangl


From: ELPA Syncer
Subject: [elpa] externals/speedrect c47e5e4e7b 43/90: move commands: use rectangle-right/next-line
Date: Fri, 6 Dec 2024 18:59:13 -0500 (EST)

branch: externals/speedrect
commit c47e5e4e7bb398dba5d245a1b396f234c0d724da
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>

    move commands: use rectangle-right/next-line
---
 speedrect.el | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/speedrect.el b/speedrect.el
index 3227b1d267..555d85e96a 100644
--- a/speedrect.el
+++ b/speedrect.el
@@ -80,13 +80,11 @@ rect and exit `rectangle-mark-mode'."
 Note that point and mark will not move beyond the end of text on their lines."
   (interactive "P")
   (let ((p (point))
-       (pcol (current-column))
-       (columns (or columns 1))
-       (mcol (progn (goto-char (mark)) (current-column))))
-    (move-to-column (max 0 (+ mcol columns)))
+       (columns (or columns 1)))
+    (rectangle-right-char columns)
     (set-mark (point))
     (goto-char p)
-    (move-to-column (max 0 (+ pcol columns)))))
+    (rectangle-right-char columns)))
 
 (defun speedrect-shift-right-fast (columns)
   "Shift the current speedrect left by COLUMNS (default 5)."
@@ -107,15 +105,12 @@ Note that point and mark will not move beyond the end of 
text on their lines."
   "Shift rectangle down by LINES."
   (interactive "P")
   (let ((p (point))
-       (pcol (current-column))
-       (lines (or lines 1))
-       (mcol (progn (goto-char (mark)) (current-column))))
-    (forward-line lines)
-    (move-to-column mcol)
+       (lines (or lines 1)))
+    (goto-char (mark))
+    (rectangle-next-line lines)
     (set-mark (point))
     (goto-char p)
-    (forward-line lines)
-    (move-to-column pcol)))
+    (rectangle-next-line lines)))
 
 (defun speedrect-shift-down-fast (lines)
   "Shift the current speedrect down by LINES (default 5)."



reply via email to

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