emacs-devel
[Top][All Lists]
Advanced

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

Re: Native display of line numbers


From: Eli Zaretskii
Subject: Re: Native display of line numbers
Date: Sat, 24 Jun 2017 00:04:51 +0300

> From: Stefan Monnier <address@hidden>
> Date: Fri, 23 Jun 2017 12:23:06 -0400
> 
> > Anyway, implementing this will need to code a whole different method
> > of counting lines (the current branch just reuses the same code which
> > produces the line numbers in the mode line), so I will need to
> > experiment to see if it can be implemented fast enough to avoid
> > slowing down redisplay, which is already slower in folded buffers.
> 
> Indeed, to make it fast enough it probably needs to count lines using
> the matrices rather than the buffer.

No, I cannot use the glyph matrices, because the line numbers are
generated when the glyph matrix is created, and because the previous
matrix cannot be trusted in general.

I need to use the move_it_in_display_line_to and its ilk instead.

> That should actually make it faster than absolute line numbers (at
> least in large buffers).

I'm not sure.  I actually fear it's the other way around, because
counting logical lines is implemented by fast code using memchr,
whereas move_it_in_display_line_to must move one character at a time.
But it could well be that this is fast enough, especially since
relative line numbers never need us to go more than one window-full
away.



reply via email to

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