Skip to content

Commit

Permalink
perf ui: Make END go to the last entry, not the top of the last page
Browse files Browse the repository at this point in the history
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: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Jul 17, 2010
1 parent 31a05a4 commit 63f20e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/perf/util/newt.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,11 @@ static int ui_browser__run(struct ui_browser *self, struct newtExitStruct *es)
break;
case NEWT_KEY_END:
offset = self->height - 1;
if (offset >= self->nr_entries)
offset = self->nr_entries - 1;

if (offset > self->nr_entries)
offset = self->nr_entries;

self->index = self->first_visible_entry_idx = self->nr_entries - 1 - offset;
self->index = self->nr_entries - 1;
self->first_visible_entry_idx = self->index - offset;
self->seek(self, -offset, SEEK_END);
break;
case NEWT_KEY_RIGHT:
Expand Down

0 comments on commit 63f20e7

Please sign in to comment.