bool cfg_stderr;
bool cfg_sleep;
bool cfg_slowscroll, cfg_smoothscroll;
-int cfg_jumpscrolllines;
+int cfg_jumpscrolllines, cfg_smoothscrollskip;
int cfg_leading;
int cfg_inputsleep, cfg_inputsleepskip;
bool cfg_uppercaseview;
cfg_sleep = false;
cfg_slowscroll = SLOW_SCROLL;
cfg_smoothscroll = SMOOTH_SCROLL;
+ cfg_smoothscrollskip = SMOOTH_SCROLL_SKIP;
cfg_jumpscrolllines = JUMP_SCROLL_LINES;
cfg_leading = EXTRA_LEADING;
* JUMP_SCROLL_LINES specifies how many lines of scrolling to allow at a time
* before forcing a refresh. SMOOTH_SCROLL means that pixel-level smooth
* scrolling should be enabled when SLOW_SCROLL is also enabled.
+ * SMOOTH_SCROLL_SKIP configures how many vertical pixels to scroll per frame.
*/
#define SLOW_SCROLL false
#define SMOOTH_SCROLL false
+#define SMOOTH_SCROLL_SKIP 1
#define JUMP_SCROLL_LINES 8
extern bool cfg_slowscroll, cfg_smoothscroll;
-extern int cfg_jumpscrolllines;
+extern int cfg_jumpscrolllines, cfg_smoothscrollskip;
/*
* If done, disable and request one last full refresh.
*/
if (st->smoothscroll_offset > 0) {
- /* XXX Skip could be configurable */
- if (--st->smoothscroll_offset <= 0) {
+ if ((st->smoothscroll_offset -= cfg_smoothscrollskip) <= 0) {
st->smoothscroll_offset = 0;
st->text_updateall = true;
}
errno = EINVAL;
fprintf(stderr,
- "\nUsage: %s [-1] [-8|-u] [-w <cols>] [-h <rows>] [-E <n>] [-s]\n"
- " [-C <col>] [-c] [-W] [-b] [-r <ms>] [-B <ticks>[,<ticks>]]\n"
- " [-j <n>] [-P] [-m <mode>] [-M] [-d] [-D] [-S]\n"
- " [-p <parameters>] [-l <pixels>] [-f <delay>] [-U] [-z <ms>]\n"
- " [-Z <skip>] [-e <command> [<arguments>]]\n\n"
+ "\nUsage: %s [-1 | -2] [-8|-u] [-w <cols>] [-h <rows>] [-E <n>]\n"
+ " [-s] [-C <col>] [-c] [-W] [-b] [-r <ms>]\n"
+ " [-B <ticks>[,<ticks>]] [-j <n>] [-P] [-m <mode>] [-M] [-d]\n"
+ " [-D] [-S] [-p <parameters>] [-l <pixels>] [-f <delay>]\n"
+ " [-U] [-z <ms>] [-Z <skip>] [-e <command> [<arguments>]]\n\n"
"Where:\n"
" -1 - Activate slow and smooth scrolling at startup.\n"
+ " -2 - Like -1 but scrolls at 2x speed (2 pixels per frame).\n"
" -8 / -u - 8-bit mode (Latin-1), unicode+UTF-8. 8-bit mode is\n"
" automatically enabled by default if the LANG\n"
" environment variable is \"C\" or contains \"8859\".\n"
progname = strdup(argv[0]);
while ((ch = getopt(argc, argv,
- "?18uw:h:E:scC:Wr:bB:j:Pm:MdDSp:l:f:Uz:Z:e:")) != -1) {
+ "?128uw:h:E:scC:Wr:bB:j:Pm:MdDSp:l:f:Uz:Z:e:")) != -1) {
switch (ch) {
case '1':
cfg_slowscroll = cfg_smoothscroll = true;
break;
+ case '2':
+ cfg_slowscroll = cfg_smoothscroll = true;
+ cfg_smoothscrollskip = 2;
+ break;
case '8':
cfg_unicode = false;
break;