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

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

[nongnu] elpa/multiple-cursors 21e4825 387/434: mc/mark-previous-like-th


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 21e4825 387/434: mc/mark-previous-like-this-word/symbol.
Date: Sat, 7 Aug 2021 09:21:05 -0400 (EDT)

branch: elpa/multiple-cursors
commit 21e48250ecdb2414e3a54ceefd75e91bccd6809a
Author: Andrea Orru <andreaorru1991@gmail.com>
Commit: Andrea Orru <andreaorru1991@gmail.com>

    mc/mark-previous-like-this-word/symbol.
---
 mc-mark-more.el | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/mc-mark-more.el b/mc-mark-more.el
index 25f4ae3..27a84b7 100644
--- a/mc-mark-more.el
+++ b/mc-mark-more.el
@@ -226,6 +226,42 @@ With zero ARG, skip the last one and mark next."
   (mc/maybe-multiple-cursors-mode))
 
 ;;;###autoload
+(defun mc/mark-previous-like-this-word (arg)
+  "Find and mark the previous part of the buffer matching the currently active 
region
+If no region is active, mark the word at the point and find the previous match
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark previous."
+  (interactive "p")
+  (if (< arg 0)
+      (let ((cursor (mc/furthest-cursor-after-point)))
+       (if cursor
+           (mc/remove-fake-cursor cursor)
+         (error "No cursors to be unmarked")))
+    (if (region-active-p)
+        (mc/mark-more-like-this (= arg 0) 'backwards)
+      (mc--select-thing-at-point 'word)
+      (mc/mark-more-like-this (= arg 0) 'backwards)))
+  (mc/maybe-multiple-cursors-mode))
+
+(defun mc/mark-previous-like-this-symbol (arg)
+  "Find and mark the previous part of the buffer matching the currently active 
region
+If no region is active, mark the symbol at the point and find the previous 
match
+With negative ARG, delete the last one instead.
+With zero ARG, skip the last one and mark previous."
+  (interactive "p")
+  (if (< arg 0)
+      (let ((cursor (mc/furthest-cursor-after-point)))
+       (if cursor
+           (mc/remove-fake-cursor cursor)
+         (error "No cursors to be unmarked")))
+    (if (region-active-p)
+        (mc/mark-more-like-this (= arg 0) 'backwards)
+      (mc--select-thing-at-point 'symbol)
+      (mc/mark-more-like-this (= arg 0) 'backwards)))
+  (mc/maybe-multiple-cursors-mode))
+
+
+;;;###autoload
 (defun mc/mark-previous-word-like-this (arg)
   "Find and mark the previous part of the buffer matching the currently active 
region
 The matching region must be a whole word to be a match



reply via email to

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