[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hl-line-mode and visual-line-mode

From: Titus von der Malsburg
Subject: hl-line-mode and visual-line-mode
Date: Thu, 22 Dec 2011 16:55:48 +0100

In visual-line-mode, global-hl-line-mode marks the whole paragraph
(the buffer line) instead of only the visual line.  This can be fixed
with this redefinition of hl-line-range-function:
  (defun visual-line-line-range ()    (save-excursion      (cons
(progn (vertical-motion 0) (point))            (progn (vertical-motion
1) (point)))))

   (setq hl-line-range-function 'visual-line-line-range)

This works nicely except that it doesn't highlight the whole line but
only the text contained in that line.  The space between the last word
and the margin is not marked.  Only lines that end with a newline
character are completely highlighted.  How can I fix this?

Thanks for any suggestions!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]