Hi, I wrote a small (but nice!) plugin that works similarly to :set
number, except that it uses :signs to show line numbers of current
screen, from 1 to last screen line. It maps <space> (via 'H') to go to
[count] screen line and when no count is given, it refreshes the
numbers.

One issue that I've run into is that there's no quick way to determine
if any lines were deleted or pasted.  When a command simply moves the
screen (e.g. j on the last line), it's easy to check location of top
line of screen using line() function - if it changed, I refresh line
numbers.

Obviously, if I deleted/added a few lines, top line of screen number in
most cases won't change, bottom line of screen number also won't change,
the line num that will change is the last line of the file, but if I
check for that, unfortunately there's an unacceptable performance hit. I
check it using line("$"). (note that when the last line num did not change,
this check is quick, but when it did change, it's very slow).

Is there some trick I'm missing that could do this quickly? In effect,
something like an event NumberOfLinesInfileChanged would be perfect.. or
a workaround that does the same thing.. or a way to speed up check for
the number of last line..

Another related thing is that actual refreshing of :signs can be also
pretty slow, especially in insert mode and it's more noticeable when
you're working near the bottom of the screen because you can see the
numbers changing on the left side after some delay, although that does
not slow down your input.

Any help/advice would be great.. -ak

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to