Open duianto opened 7 years ago
This is a known issue on Windows and Mac. To turn off that behavior and have the fake cursors have the default cursor face set this variable evil-mc-enable-bar-cursor
to nil.
Thanks, setting the evil-mc-enable-bar-cursor
variable to nil
stops the line height from changing.
If there aren't any downsides to using XPM images as the additional cursors. Then I might have found a solution to the Windows cursor issue.
This question: http://stackoverflow.com/questions/23744237/emacs-how-to-create-a-vertical-strike-through-effect shows two examples of how to draw XPM images in Emacs. I modified the last example, so that it shows a 1px wide and 16px tall, vertical line (16px is the same height as the cursor).
(let* ((img `(image :type xpm :mask nil :ascent center :data
"/* XPM */
static char * img_xpm[] = {
\"1 16 1 1\",
\"* c green\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\",
\"*\"};"))
(img-str (propertize " " 'display img))
(vertical-line-overlay (make-overlay (point) (1+ (point)))))
(overlay-put vertical-line-overlay 'before-string img-str)
(internal-show-cursor nil nil)
(sit-for 2)
(internal-show-cursor nil t)
(delete-overlay vertical-line-overlay))
Here's a comparison of the normal and insert state cursors, to the XPM image (with the cursor hidden).
The XPM image looks the same in both Ubuntu and Windows.
XPM images probably won't work with text only terminals.
(display-graphic-p)
returns t
when a gui version of Emacs is used.
Maybe :mask nil
can be removed from the line:
(let* ((img `(image :type xpm :mask nil :ascent center :data
Because it seems to work the same, both with or without it.
This page describes the :mask
image descriptor: http://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Descriptors.html
Thanks, that definitely looks interesting. I'll look into using XPM images when I have some time.
Description
In windows the line height changes when one enters and exits insert state. It happens on any line with a multi cursor.
Windows 10
Ubuntu 16.10
It works as expected in Ubuntu.
System Info
The first animation for each OS shows: Emacs with the
evil-mc
package installed. The second animation shows: Spacemacs 0.200.9 (develop branch).System 1:
Emacs 25.1.1 Windows 10
System 2 (Windows 10, Virtual box host OS):
Emacs 26.0.50 Ubuntu 16.10