GNU bug report logs -
#13446
24.2; Fix loop test in linum.el
Previous Next
Reported by: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
Date: Tue, 15 Jan 2013 01:15:01 UTC
Severity: normal
Found in version 24.2
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
There is an incorrect loop test in linum.el that potentially applies an
overlay to a line not visible in the window and thereby messes up the
width of the overlays in the lines that are visible. The patch/merge
directive is attached, and what follows is the commit message:
-----
Modify loop test in `linum-update-window'.
`limit' is set to the position returned by `window-end'; this position
is either on the last visible (logical) line in the buffer or is the
first position on the line following the last visible line. In the
former case, the loop variable never reaches the value of `limit', but
in the latter case, an overlay is applied to a line that is not
visible in the window. This can mess up the width of the overlay on
the visible lines, especially if the width of the line number (as a
string) of the line that's not visible is different from the width of
the visible lines' line numbers.
[linum.patch (text/x-patch, inline)]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: nbtrap <at> nbtrap.com-20130115010121-h7kwjyr5kimowgml
# target_branch: .
# testament_sha1: a9154d3ede2b389220646bb8e9e708117d876d01
# timestamp: 2013-01-14 20:03:26 -0500
# base_revision_id: nbtrap <at> nbtrap.com-20130111013646-pn4xh5r94x5asomb
#
# Begin patch
=== modified file 'lisp/linum.el'
--- lisp/linum.el 2012-01-19 07:21:25 +0000
+++ lisp/linum.el 2013-01-15 00:45:27 +0000
@@ -151,7 +151,7 @@
(run-hooks 'linum-before-numbering-hook)
;; Create an overlay (or reuse an existing one) for each
;; line visible in this window, if necessary.
- (while (and (not (eobp)) (<= (point) limit))
+ (while (and (not (eobp)) (< (point) limit))
(let* ((str (if fmt
(propertize (format fmt line) 'face 'linum)
(funcall linum-format line)))
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWdjgvvgAABJfgAAQQGFxUBIA
AACv794QIABkRTaajamQyGjTaRiFGgBMBBkwQhDmaVnH5r9hMFQyJ7EUzThiw4Ixc/mQVpexbPS2
9yLLTxaFbWvXcN2zcydOQxpD652acQC4g4Z96jI5BipgKAAiM5Zz45Kd/4u5IpwoSGxwX3wA
This bug report was last modified 11 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.