perf ui: Make END go to the last entry, not the top of the last page

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 31a05a41
...@@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es) ...@@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
break; break;
case NEWT_KEY_END: case NEWT_KEY_END:
offset = self->height - 1; offset = self->height - 1;
if (offset >= self->nr_entries)
offset = self->nr_entries - 1;
if (offset > self->nr_entries) self->index = self->nr_entries - 1;
offset = self->nr_entries; self->first_visible_entry_idx = self->index - offset;
self->index = self->first_visible_entry_idx = self->nr_entries - 1 - offset;
self->seek(self, -offset, SEEK_END); self->seek(self, -offset, SEEK_END);
break; break;
case NEWT_KEY_RIGHT: case NEWT_KEY_RIGHT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment