Detect cursor bar type when specified by the frame.

When the 'cursor-type' for the buffer is specified by the frame, this
was not detected by the current logic as 'cursor-type' will be set to
't' and thus not explicitly match 'bar'.  This update checks to see if
'cursor-type' is specified by the frame and will pull the parameter
from the frame if it is, prior to subsequent checks.
This commit is contained in:
Troy Brown 2022-11-25 23:22:14 -05:00 committed by Magnar Sveen
parent 1e4842d129
commit fe0d516745

View File

@ -122,9 +122,13 @@ rendered or shift text."
(defun mc/cursor-is-bar () (defun mc/cursor-is-bar ()
"Return non-nil if the cursor is a bar." "Return non-nil if the cursor is a bar."
(let ((cursor-type
(if (eq cursor-type t)
(frame-parameter nil 'cursor-type)
cursor-type)))
(or (eq cursor-type 'bar) (or (eq cursor-type 'bar)
(and (listp cursor-type) (and (listp cursor-type)
(eq (car cursor-type) 'bar)))) (eq (car cursor-type) 'bar)))))
(defun mc/line-number-at-pos (&optional pos absolute) (defun mc/line-number-at-pos (&optional pos absolute)
"Faster implementation of `line-number-at-pos'." "Faster implementation of `line-number-at-pos'."