问题
Does anyone have an alternative to, or a modification of, hl-line-mode so that just one (1) horizontal line will be highlighted when visual-line-mode is enabled?
Presently, the entire word-wrapped line gets highlighted, even though it may span several horizontal lines. I'm using a fairly recent version of Emacs Trunk.
回答1:
You should be able to control this using hl-line-range-function, giving it code that stops at the position used by end-of-visual-line.
(100% untested -- just checked the source code a bit. And no, I do not use visual-line-mode.)
来源:https://stackoverflow.com/questions/20275596/how-to-use-hl-line-mode-to-highlight-just-one-1-line-when-visual-line-mode-is