branch: externals/shift-number
commit 8b68f9962b4b68e2fc44fe9af90a57f7b4405698
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Add an option to move the cursor to the numbers end
---
shift-number.el | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/shift-number.el b/shift-number.el
index 70881a6b8d..f275ac4c65 100644
--- a/shift-number.el
+++ b/shift-number.el
@@ -40,6 +40,10 @@ The first parenthesized expression must match the number."
"If non-nil, support negative numbers."
:type 'boolean)
+(defcustom shift-number-motion nil
+ "If non-nil, move the point to the end of the number."
+ :type 'boolean)
+
(declare-function apply-on-rectangle "rect")
(defun shift-number--replace-in-region (str beg end)
@@ -206,6 +210,9 @@ Otherwise search forward limited by LIMIT-END."
(goto-char old-pos)
+ (when shift-number-motion
+ (goto-char new-end))
+
new-end)))
(defun shift-number--on-region-impl (n region-beg region-end)