Speed up the visual-mode relative line numbers
commit0e4f2e01af1f4c51b958057d86e28c04cdefddb4
authorEli Zaretskii <eliz@gnu.org>
Fri, 30 Jun 2017 12:55:51 +0000 (30 15:55 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 30 Jun 2017 12:55:51 +0000 (30 15:55 +0300)
tree5a085ee96e05cd12f610f46f1ead1618efd04718
parenta06dd3b9187489b61f08256d9e9a07745302dc4e
Speed up the visual-mode relative line numbers

* src/xdisp.c (display_count_lines_visually): Introduce a
shortcut: if a relative line number was already calculated for
this iterator object, just increase it instead of the
expensive call to move_it_to.  Argument list changed to pass a
pointer to the iterator object.
(maybe_produce_line_number): Adjust for change in signature of
display_count_lines_visually.  Record the relative line number and
the corresponding byte position in the iterator object also in the
'visual' mode.
src/xdisp.c