author | Jeffrey Middleton <jefromi@gmail.com> | |
Tue, 7 Apr 2009 18:30:43 +0000 (13:30 -0500) | ||
committer | Jeffrey Middleton <jefromi@gmail.com> | |
Wed, 8 Apr 2009 23:52:39 +0000 (18:52 -0500) | ||
commit | abd152996b9d591f80a6160867ed72f8448afd28 | |
tree | 1362d9d259084af075daf0e93945acd897aa958c | tree | snapshot |
parent | 44c77744be086e18a1cb502bad66aface0285d45 | commit | diff |
added scroll-offset option; fixed scrolling bug
scroll-offset (default 0) is the number of entries to be displayed on
either side of the cursor; this helps the user avoid overshooting when
moving the cursor to a desired entry past the end of the window. The
exact behavior is copied from Vim, as detailed below.
The interaction with the top/bottom (H/L) commands is the same as in
Vim: they jump to the top+offset/bottom-offset, unless the top/bottom is
the beginning/end of the list, in which case they jump all the way to
the edge.
Large values of the offset (at least half the screen height) also work
the same as in Vim, causing the cursor to always be centered.
Finally, there is some slightly odd behavior when using scrolling
commands while the cursor is in the offset range at the edge of the
list. For example, if the screen is scrolled to the top, and the cursor
is also on the first item, scrolling down by a line causes the cursor to
jump down to the offset position. This is also the same as Vim and I
don't really see a better (but simple) alternative.
The behavior of the scroll down command at the bottom of the list was
also broken; this was fixed here instead of separately since the
relevant code was modified for this update anyway.
scroll-offset (default 0) is the number of entries to be displayed on
either side of the cursor; this helps the user avoid overshooting when
moving the cursor to a desired entry past the end of the window. The
exact behavior is copied from Vim, as detailed below.
The interaction with the top/bottom (H/L) commands is the same as in
Vim: they jump to the top+offset/bottom-offset, unless the top/bottom is
the beginning/end of the list, in which case they jump all the way to
the edge.
Large values of the offset (at least half the screen height) also work
the same as in Vim, causing the cursor to always be centered.
Finally, there is some slightly odd behavior when using scrolling
commands while the cursor is in the offset range at the edge of the
list. For example, if the screen is scrolled to the top, and the cursor
is also on the first item, scrolling down by a line causes the cursor to
jump down to the offset position. This is also the same as Vim and I
don't really see a better (but simple) alternative.
The behavior of the scroll down command at the bottom of the list was
also broken; this was fixed here instead of separately since the
relevant code was modified for this update anyway.
doc/ncmpc.1 | diff | blob | history | |
src/conf.c | diff | blob | history | |
src/list_window.c | diff | blob | history | |
src/options.c | diff | blob | history | |
src/options.h | diff | blob | history |