[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align com
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align commands |
Date: |
Sat, 7 Aug 2021 09:20:49 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 7ddda8527b8126fc26a6700136497f7dd4a0e525
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Commit: Patrick Seebauer <patrick.seebuaer@web.de>
Added vertical align commands
Squashed commit of the following:
commit 243a14e69501bf938eea54449782f43be2084ef2
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Fri Sep 5 18:06:19 2014 +0200
removed uniq line check and added warning in the docs about cursors on
the same line.
commit 438658ef0358b0a1540c2663aedba0253150a007
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Fri Sep 5 17:59:55 2014 +0200
fixed tests for commands with character inputs
commit c565969c6bb01e37ec42cfe311ada87643e38ccc
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Fri Sep 5 17:36:41 2014 +0200
renamed to vertical align, added non-whitespace option
commit 941c40a319f571680017293681ff7d796ba4e1f4
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Fri Sep 5 16:58:14 2014 +0200
added test
commit d9a4a55ebde9b51c3f62b14948529759aaaa9bf6
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Tue Sep 2 19:32:49 2014 +0200
added interactives, added abort if cursors are on the same line
commit 12d01fe4db5109061533b0524d99177d1204eb85
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Tue Sep 2 18:55:47 2014 +0200
some adjustments
commit 9fddf98b6cd1bb68c334ab46fe1c9bcc08397796
Author: Patrick Seebauer <patrick.seebuaer@web.de>
Date: Tue Sep 2 18:47:39 2014 +0200
rough sketch
---
features/vertical-align.feature | 27 +++++++++++++++++++++++++++
mc-separate-operations.el | 32 ++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/features/vertical-align.feature b/features/vertical-align.feature
new file mode 100644
index 0000000..3a5a124
--- /dev/null
+++ b/features/vertical-align.feature
@@ -0,0 +1,27 @@
+Feature: Align cursors with whitespaces
+
+ Scenario: Vertical aligning with `x'
+ Given I have cursors at "word" in :
+ """
+ One word
+ Another word
+ """
+ And I press "<<mc/vertical-align>> \170"
+ Then I should see:
+ """
+ One xxxxword
+ Another word
+ """
+
+ Scenario: Vertical aligning with space
+ Given I have cursors at "word" in :
+ """
+ One word
+ Another word
+ """
+ And I press "<<mc/vertical-align-with-space>>"
+ Then I should see:
+ """
+ One word
+ Another word
+ """
diff --git a/mc-separate-operations.el b/mc-separate-operations.el
index abbfaee..7543232 100644
--- a/mc-separate-operations.el
+++ b/mc-separate-operations.el
@@ -86,5 +86,37 @@
(setq mc--strings-to-replace (sort (mc--ordered-region-strings) 'string<))
(mc--replace-region-strings))
+
+;;;###autoload
+(defun mc/vertical-align (character)
+ "Aligns all cursors vertically with a given CHARACTER to the one with the
+highest colum number (the rightest)
+Aborts if the some cursors are on the same line.
+Might not behave as intended if more than one cursors are on the same line."
+ (interactive "c")
+ (let ((rightest-column (current-column)))
+ (mc/execute-command-for-all-cursors
+ (lambda () "get the rightest cursor"
+ (interactive)
+ (setq rightest-column (max (current-column) rightest-column))
+ ))
+ (mc/execute-command-for-all-cursors
+ (lambda ()
+ (interactive)
+ (let ((missing-spaces (- rightest-column (current-column))))
+ (save-excursion (insert (make-string missing-spaces character)))
+ (forward-char missing-spaces)
+ )
+ ))
+ )
+ )
+
+;;;###autoload
+(defun mc/vertical-align-with-space ()
+ "Aligns all cursors with whitespace like `mc/vertical-align' does"
+ (interactive)
+ (mc/vertical-align 32)
+ )
+
(provide 'mc-separate-operations)
;;; mc-separate-operations.el ends here
- [nongnu] elpa/multiple-cursors bf01772 230/434: Use phi-search for C-s in mc-mode when available., (continued)
- [nongnu] elpa/multiple-cursors bf01772 230/434: Use phi-search for C-s in mc-mode when available., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 186cb3b 255/434: Release 1.2.3, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors c94eca5 254/434: Fix broken let binding, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d8c5227 268/434: Merge pull request #103 from mathrick/compat-24.2, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 239acbf 281/434: Skip folded lines with mc/edit-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 5cd6ddf 293/434: Merge pull request #125 from kyanagi/fix-cycle-cursors-on-edge, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d1ad51f 296/434: Gitignore *.elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a3e6ec7 297/434: Merge pull request #135 from jistr/gitignore_elc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc39dab 299/434: Adds jedi-mode to list of unsupported minor modes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors da2a9ab 298/434: Add mc/mark-all-in-region-regexp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7ddda85 312/434: Added vertical align commands,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 912342e 315/434: Add missing ###autoload markers, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66eefa2 317/434: Add cperl-electric-backspace to default run-for-all list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dc1bfbf 325/434: Add cua-delete-region to default run-for-all, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 89e360e 333/434: Merge pull request #193 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 4969d38 331/434: Move mc/list-file to the user-emacs-directory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 49c9f7f 340/434: Merge remote-tracking branch 'upstream/master', ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9b53e89 344/434: Merge pull request #203 from dovej/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ca822cd 347/434: Add mc/insert-letters function and test cases, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 54c05c3 356/434: Add more aliases for cl stuff, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 40eb74e 357/434: Extend mc/add-cursor-on-click to toggle fake cursors, ELPA Syncer, 2021/08/07