[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/multiple-cursors 3112e61 377/434: When cursor-type is bar,
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/multiple-cursors 3112e61 377/434: When cursor-type is bar, mc/cursors appear as bars |
Date: |
Sat, 7 Aug 2021 09:21:03 -0400 (EDT) |
branch: elpa/multiple-cursors
commit 3112e618248097f392b8a6c87d4e12a28da2977c
Author: Jules Tamagnan <jtamagnan@gmail.com>
Commit: Jules Tamagnan <jtamagnan@gmail.com>
When cursor-type is bar, mc/cursors appear as bars
---
multiple-cursors-core.el | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index aa5b2c2..9507cbc 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -35,6 +35,11 @@
"The face used for fake cursors"
:group 'multiple-cursors)
+(defface mc/cursor-bar-face
+ `((t (:height 1 :background ,(face-attribute 'cursor :background))))
+ "The face used for fake cursors if the cursor-type is bar"
+ :group 'multiple-cursors)
+
(defface mc/region-face
'((t :inherit region))
"The face used for fake regions"
@@ -98,16 +103,26 @@
(set-marker ,p nil)
(set-marker ,s nil))))
+(defun mc/cursor-is-bar ()
+ "returns true if the cursor is a bar"
+ (cond ((equalp cursor-type 'bar) t)
+ ((when (listp cursor-type) (equalp (car cursor-type) 'bar)) t)
+ (t nil)))
+
(defun mc/make-cursor-overlay-at-eol (pos)
"Create overlay to look like cursor at end of line."
(let ((overlay (make-overlay pos pos nil nil nil)))
- (overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face))
+ (if (mc/cursor-is-bar)
+ (overlay-put overlay 'before-string (propertize "|" 'face
'mc/cursor-bar-face))
+ (overlay-put overlay 'after-string (propertize " " 'face
'mc/cursor-face)))
overlay))
(defun mc/make-cursor-overlay-inline (pos)
"Create overlay to look like cursor inside text."
(let ((overlay (make-overlay pos (1+ pos) nil nil nil)))
- (overlay-put overlay 'face 'mc/cursor-face)
+ (if (mc/cursor-is-bar)
+ (overlay-put overlay 'before-string (propertize "|" 'face
'mc/cursor-bar-face))
+ (overlay-put overlay 'face 'mc/cursor-face))
overlay))
(defun mc/make-cursor-overlay-at-point ()
- [nongnu] elpa/multiple-cursors 0a081a7 184/434: Move mc/maybe-multiple-cursors-mode to core., (continued)
- [nongnu] elpa/multiple-cursors 0a081a7 184/434: Move mc/maybe-multiple-cursors-mode to core., ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 9a376a6 201/434: Add note about yank-rectangle, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors e7605bb 194/434: Merge pull request #42 from purcell/cleanup, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d24ddc5 217/434: Default ECUKES_EMACS to $EMACS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 94af074 240/434: Add some readability enhancing step definitions, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 66ceb0b 246/434: Revert cursor specific pre- & post-command-hooks, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 725369c 253/434: Merge pull request #97 from knu/fix-mc-mark-pop-doc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors bbbe90d 349/434: Minor changes mark-next-like-this-word and readme, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors dd07bc5 351/434: Merge pull request #228 from jtamagnan/mark-next-like-this-word, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 8297f1f 363/434: Merge pull request #241 from YoungFrog/fix-#230, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 3112e61 377/434: When cursor-type is bar, mc/cursors appear as bars,
ELPA Syncer <=
- [nongnu] elpa/multiple-cursors 8413969 383/434: Merge pull request #253 from jtamagnan/fake-bar-cursor, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors ddbe3ae 396/434: Merge pull request #278 from shlomme/master, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d2766bc 400/434: tips and tricks: add note about <return> and newlines; if it is not default, let it at least be more discoverable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 0e49fec 410/434: Merge pull request #326 from pstray/issue325, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 1075270 407/434: Added mc/interactive-repeating-commands (#303), ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 038815b 414/434: Make "no more matches found." user-error, fix #218, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors d27870d 421/434: Load mc/list-file as late as possible, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors fc6a6a7 422/434: Merge pull request #355 from flatwhatson/lazy-list-file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors 7763f4f 429/434: Load mc-cycle-cursors and mc-hide-unmatched-lines-mode after loading multiple-cursors-core, ELPA Syncer, 2021/08/07
- [nongnu] elpa/multiple-cursors a9d7764 431/434: Add option to disable bar-style fake cursors (#367), ELPA Syncer, 2021/08/07