mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 05:03:03 +00:00
Add option to disable bar-style fake cursors (#367)
This commit is contained in:
parent
83abb0533a
commit
a9d7764f80
@ -40,6 +40,18 @@
|
|||||||
"The face used for fake cursors if the cursor-type is bar"
|
"The face used for fake cursors if the cursor-type is bar"
|
||||||
:group 'multiple-cursors)
|
: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
|
(defface mc/region-face
|
||||||
'((t :inherit region))
|
'((t :inherit region))
|
||||||
"The face used for fake regions"
|
"The face used for fake regions"
|
||||||
@ -125,7 +137,7 @@
|
|||||||
(defun mc/make-cursor-overlay-at-eol (pos)
|
(defun mc/make-cursor-overlay-at-eol (pos)
|
||||||
"Create overlay to look like cursor at end of line."
|
"Create overlay to look like cursor at end of line."
|
||||||
(let ((overlay (make-overlay pos pos nil nil nil)))
|
(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 'before-string (propertize "|" 'face 'mc/cursor-bar-face))
|
||||||
(overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face)))
|
(overlay-put overlay 'after-string (propertize " " 'face 'mc/cursor-face)))
|
||||||
overlay))
|
overlay))
|
||||||
@ -133,7 +145,7 @@
|
|||||||
(defun mc/make-cursor-overlay-inline (pos)
|
(defun mc/make-cursor-overlay-inline (pos)
|
||||||
"Create overlay to look like cursor inside text."
|
"Create overlay to look like cursor inside text."
|
||||||
(let ((overlay (make-overlay pos (1+ pos) nil nil nil)))
|
(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 'before-string (propertize "|" 'face 'mc/cursor-bar-face))
|
||||||
(overlay-put overlay 'face 'mc/cursor-face))
|
(overlay-put overlay 'face 'mc/cursor-face))
|
||||||
overlay))
|
overlay))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user