diff options
author | Guo Ci <zguoci@gmail.com> | 2017-06-21 23:29:50 +0200 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2017-06-21 23:29:50 +0200 |
commit | 6a2f12c28a677ba814575d42825434bfb970e4e9 (patch) | |
tree | e9d9418f4d80001c8a44baa0bf2d5ac1e201b3b2 /src/window.h | |
parent | d23b14f9712f213b7e7faed21e9730001c7fe5b4 (diff) | |
download | screen-6a2f12c28a677ba814575d42825434bfb970e4e9.tar.gz |
begin viewing scrollback buffer at the first line of output instead of at the start of the scrollback buffer
This issue has been discussed before:
https://bbs.archlinux.org/viewtopic.php?id=108640
Copy mode and “hardcopy -h” always begin at the start of the scrollback buffer.
If a user sets a large scrollback limit with little output, then copy mode and
the file written by “hardcopy -h” will begin with many blank lines before the
first line of output.
The attached patch limits the scrollback buffer traversal to begin at the first
line of output, instead of the beginning of the scrollback buffer.
Also, code for moving to %age of buffer is changed to use float division so
that two different rep_cnt will not jump to the same location, except for
buffers less than 100 lines. Previously, the computed line number is rounded
down to the nearest 100th due to integer division.
Bug: 49377
Diffstat (limited to 'src/window.h')
-rw-r--r-- | src/window.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h index 59b058d..5400b41 100644 --- a/src/window.h +++ b/src/window.h @@ -224,6 +224,7 @@ struct Window { int w_slowpaste; /* do careful writes to the window */ int w_histheight; /* all histbases are malloced with width * histheight */ int w_histidx; /* 0 <= histidx < histheight; where we insert lines */ + int w_scrollback_height; /* number of lines of output stored, to be updated with w_histidx, w_histheight */ struct mline *w_hlines; /* history buffer */ struct paster w_paster; /* paste info */ pid_t w_pid; /* process at the other end of ptyfd */ |