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.