all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15090: linum-mode and visual-line-mode (both defaults) have conflicting behavior
@ 2013-08-13 20:52 Dave Kepler
  2013-08-13 21:33 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dave Kepler @ 2013-08-13 20:52 UTC (permalink / raw)
  To: 15090

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

When you set:

(global-visual-line-mode 1)
(global-linum-mode 1)

you sometimes get weird behavior.  If the [visual] line at the top of your
window is not completely visible (i.e. some parts of it lie above your
screen), you can sometimes trigger horizontal movement in that top line by
performing random commands: moving, inserting text.  Most consistently
(though not always), I've been able to do cause this behavior by scrolling
down when my cursor is at the end of a file.

I am pretty sure this happens when linum "updates" the line number of the
topmost line.  The problem only occurs during a linum-update, and after my
workaround, that top line number is no longer visible.


Workaround (I'm not really sure it fixes the underlying problem):

Change the first line in function "linum-update-window" (I believe:
linum.el, line 134) from:

  (goto-char (window-start win))

to:

  (goto-char (1- (window-start win)))

or, with indexing check:

(goto-char (let ((first-char (window-start win)))
                 (if (> first-char (point-min))
                     (1- first-char)
                     first-char)))

Partial Rationale: I knew that lines after the starting point didn't have
this problem, so I was trying to make it start at the previous line.  It
turns out that starting at the previous character fixes it.  I don't really
know why.

[-- Attachment #2: Type: text/html, Size: 1753 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-15 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 20:52 bug#15090: linum-mode and visual-line-mode (both defaults) have conflicting behavior Dave Kepler
2013-08-13 21:33 ` Stefan Monnier
2013-08-14  2:51 ` Eli Zaretskii
2013-08-15  3:47 ` Dave Kepler
2013-08-15 15:22   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.