How to use hl-line-mode to highlight just one (1) line when visual-line-mode is enabled

半世苍凉 提交于 2019-12-01 07:09:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!