emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/multiple-cursors a9d7764 431/434: Add option to disable ba


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors a9d7764 431/434: Add option to disable bar-style fake cursors (#367)
Date: Sat, 7 Aug 2021 09:21:15 -0400 (EDT)

branch: elpa/multiple-cursors
commit a9d7764f80b241978f3d4e76bc981ef10bab5d70
Author: Zach Kost-Smith <zachkostsmith@gmail.com>
Commit: GitHub <noreply@github.com>

    Add option to disable bar-style fake cursors (#367)
---
 multiple-cursors-core.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 5b6ef5a..6db87a8 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -40,6 +40,18 @@
   "The face used for fake cursors if the cursor-type is bar"
   :group 'multiple-cursors)
 
+(defcustom mc/match-cursor-style t
+  "If non-nil, attempt to match the cursor style that the user
+has selected.  Namely, use vertical bars the user has configured
+Emacs to use that cursor.
+
+If nil, just use standard rectangle cursors for all fake cursors.
+
+In some modes/themes, the bar fake cursors are either not
+rendered or shift text."
+  :type '(boolean)
+  :group 'multiple-cursors)
+
 (defface mc/region-face
   '((t :inherit region))
   "The face used for fake regions"
@@ -125,7 +137,7 @@
 (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)))
-    (if (mc/cursor-is-bar)
+    (if (and mc/match-cursor-style (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))
@@ -133,7 +145,7 @@
 (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)))
-    (if (mc/cursor-is-bar)
+    (if (and mc/match-cursor-style (mc/cursor-is-bar))
        (overlay-put overlay 'before-string (propertize "|" 'face 
'mc/cursor-bar-face))
       (overlay-put overlay 'face 'mc/cursor-face))
     overlay))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]