[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 533e157 335/434: Merge pull request #160
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 533e157 335/434: Merge pull request #160 from P-Seebauer/master |
Date: |
Sat, 7 Aug 2021 09:20:54 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 533e1576e309abf6e3ff98eb9ede807f00f1ef0c
Merge: faf331d 7156651
Author: Magnar Sveen <magnars@gmail.com>
Commit: Magnar Sveen <magnars@gmail.com>
Merge pull request #160 from P-Seebauer/master
Added whitespace functionality.
---
features/vertical-align.feature | 27 +++++++++++++++++++++++++++
mc-separate-operations.el | 31 +++++++++++++++++++++++++++++++
2 files changed, 58 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..b587530 100644
--- a/mc-separate-operations.el
+++ b/mc-separate-operations.el
@@ -86,5 +86,36 @@
(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).
+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 3e31cc6 101/434: Merge pull request #5 from milkypostman/master, (continued)
- [nongnu] elpa/multiple-cursors 3e31cc6 101/434: Merge pull request #5 from milkypostman/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f2add1d 107/434: Suggest C-c C-< instead of the often used M-<, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 810636b 120/434: Avoid smooth-scroll issues with multiple cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 2d639b0 284/434: Added tests for new mc/edit-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 38e590c 292/434: Fix cycle-cursor behavior., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors adf86bd 320/434: Add @lexa to list of contributors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ff0ac1f 322/434: Add function to disable mc undo into undo-list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 952877f 324/434: Revert undo-feature for multiple-cursors, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 72b4bf3 329/434: Enable to specify search word in mc/mark-all-in-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 97f7b1d 332/434: Merge pull request #197 from kissge/user-emacs-directory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 533e157 335/434: Merge pull request #160 from P-Seebauer/master,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors ccdc025 079/434: Run prefix argument commands just once., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors df5f83a 082/434: Add more common commands to run only once., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 576bf90 087/434: mc version of mark-previous-like-this, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0d89125 089/434: Added mc-version of mark-all-like-this, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors f42e467 090/434: Added mc-version of mark-all-in-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b912bf8 096/434: Always require multiple-cursors-core, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0233ba8 092/434: Add commands to run-once-list, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ef2226b 116/434: Consolidate kill-ring entries when exiting multiple-cursors-mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d5a9d57 132/434: Add minibuffer-complete-and-exit to default run-once list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors b48e2b7 137/434: mc/edit-lines: Don't include the 'invisible' line, ELPA Syncer, 2021/08/07