Fix searching the last command output

This commit is contained in:
pagedown 2022-01-15 18:38:05 +08:00
parent b32edf54f8
commit 7ea8a7d45f
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -2756,7 +2756,9 @@ cmd_output(Screen *self, PyObject *args) {
switch (which) { switch (which) {
case 0: // last run cmd case 0: // last run cmd
found = find_cmd_output(self, &oo, self->cursor->y, self->scrolled_by, -1, false); // When scrolled, the starting point of the search for the last command output
// is actually out of the screen, so add the number of scrolled lines
found = find_cmd_output(self, &oo, self->cursor->y + self->scrolled_by, self->scrolled_by, -1, false);
break; break;
case 1: // first on screen case 1: // first on screen
found = find_cmd_output(self, &oo, 0, self->scrolled_by, 1, true); found = find_cmd_output(self, &oo, 0, self->scrolled_by, 1, true);