mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-05-10 09:28:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e803180932 | |||
| e322b75297 |
+1
-25
@@ -396,7 +396,7 @@ With zero ARG, skip the last one and mark next."
|
|||||||
(while (search-forward search end t)
|
(while (search-forward search end t)
|
||||||
(push-mark (match-beginning 0))
|
(push-mark (match-beginning 0))
|
||||||
(mc/create-fake-cursor-at-point))
|
(mc/create-fake-cursor-at-point))
|
||||||
(let ((first (mc/furthest-cursor-before-point)))
|
(let ((first (car (last (mc/all-fake-cursors)))))
|
||||||
(if (not first)
|
(if (not first)
|
||||||
(error "Search failed for %S" search)
|
(error "Search failed for %S" search)
|
||||||
(mc/pop-state-from-overlay first)))
|
(mc/pop-state-from-overlay first)))
|
||||||
@@ -704,30 +704,6 @@ already there."
|
|||||||
(save-excursion
|
(save-excursion
|
||||||
(not (null (sgml-get-context)))))
|
(not (null (sgml-get-context)))))
|
||||||
|
|
||||||
(defun mc/split-region (beg end search)
|
|
||||||
"Split region each time SEARCH occurs in the buffer.
|
|
||||||
|
|
||||||
This can be thought of as an inverse to `mc/mark-all-in-region'."
|
|
||||||
(interactive "r\nsSplit on: ")
|
|
||||||
(let ((case-fold-search nil))
|
|
||||||
(if (string= search "")
|
|
||||||
(user-error "Empty search term")
|
|
||||||
(progn
|
|
||||||
(mc/remove-fake-cursors)
|
|
||||||
(goto-char beg)
|
|
||||||
(push-mark beg)
|
|
||||||
(while (search-forward search end t)
|
|
||||||
(save-excursion
|
|
||||||
(goto-char (match-beginning 0))
|
|
||||||
(mc/create-fake-cursor-at-point))
|
|
||||||
(push-mark (match-end 0)))
|
|
||||||
(unless (= (point) end)
|
|
||||||
(goto-char end))
|
|
||||||
(mc/create-fake-cursor-at-point)
|
|
||||||
(if (> (mc/num-cursors) 1)
|
|
||||||
(multiple-cursors-mode 1)
|
|
||||||
(multiple-cursors-mode 0))))))
|
|
||||||
|
|
||||||
(provide 'mc-mark-more)
|
(provide 'mc-mark-more)
|
||||||
|
|
||||||
;;; mc-mark-more.el ends here
|
;;; mc-mark-more.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user