[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs master, faces with :extend t let cursor vanish at EOL?!
From: |
Eric S Fraga |
Subject: |
Re: Emacs master, faces with :extend t let cursor vanish at EOL?! |
Date: |
Thu, 31 Oct 2019 16:55:47 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
On Wednesday, 23 Oct 2019 at 19:06, Eli Zaretskii wrote:
>> From: Kaushal Modi <address@hidden>
>> The issue occurs because of the new :extend feature for faces to extend till
>> end of lines.
[...]
> I tried to reproduce this, but couldn't. The OP says "often", so I
> understand the problem is not 100% reproducible and the exact
> situations in which it arises are not yet known.
>
> So I suggest to find a reproducible recipe and then report it with
> report-emacs-bug, so that the problem could be debugged and solved.
(emacs up to date from git a few minutes ago)
I see this, in a reproducible way, when using hl-line-mode in
combination with visual-line-mode and evil-mode. In Evil's "normal"
mode, my cursor is a block. This block disappears when at EOL if the
hl-line face is extended to include the EOL position (by modifying
hl-line-range-function). I have the following:
#+begin_src emacs-lisp
(defun esf/get-visual-line-range ()
(let (b e r)
(save-excursion
(beginning-of-visual-line)
(setq b (point))
(end-of-visual-line)
(setq e (point))
;; (setq e (+ 1 (point)))
;; (beginning-of-line)
;; (setq r (point)) ;real beginning of line
;; (if (< r b) (setq b (+ b 1))) ;adjust to avoid extension
backwards
)
(cons b e)))
(setq hl-line-range-function #'esf/get-visual-line-range)
#+end_src
If I uncomment the first commented line, and comment out the one above,
I get the hl-line face extended very nicely to the edge of the window
*but* my cursor disappears if it is past the last text character on the
line. If I keep the code as it is, the hl-line face only covers the
text, it is not extended, and the cursor is visible.
Aside: the other bits commented out are to deal with the face sometimes
extending backwards onto the previous line; another edge effect...
thanks,
eric
--
Eric S Fraga via Emacs 27.0.50 & org 9.2.6 on Debian bullseye/sid