help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: relative line numbers and folding: how to make they play along?


From: Eli Zaretskii
Subject: Re: relative line numbers and folding: how to make they play along?
Date: Thu, 14 Jul 2016 18:06:26 +0300

> From: Stefan Monnier <address@hidden>
> Date: Wed, 13 Jul 2016 22:36:49 -0400
> 
> >> I think to implement relative-visual-linum-mode efficiently, we'd need
> >> help from the display engine.  E.g.:
> >> - First perform redisplay of the window.
> >> - then, go through the window, visual-line by visual-line
> >> and add something in the margin.
> >> - then update the margin part of the matrices.
> 
> > AFAIU, this would cause a momentary flickering of an incorrect display
> > (without the line numbers), until they are computed and displayed.
> 
> Actually, I don't think there needs to be flickering if the first step
> ("perform redisplay of window") just computes the new matrices without
> performing any drawing.

Since the display engine computes the number of each screen line as it
lays them out, I don't understand why would 2 phases be needed.  I'm
probably missing something.

> > And I still don't see any answer to my question, alas.
> 
> It's basically: linum-mode but where the line numbers are relative to
> `point` rather than counting from `point-min`, and additionally it
> should count visual lines (so 10 invisible lines of text don't affect
> the line numbers of the text that is displayed).

So some lines will have negative numbers?  And they change whenever
point moves into a different line?  And when the window is scrolled,
the numbers also change?



reply via email to

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