diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-15 14:21:07 +0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-17 22:44:43 +0400 |
commit | 63f20e744a595444f7ab1d47a29c5b74830feb47 (patch) | |
tree | 7d57393b56b9371e3e664e815a81a0fb77f64fb4 /tools | |
parent | 31a05a4127c81d5d7f095c609420bf6df892a8b0 (diff) | |
download | linux-63f20e744a595444f7ab1d47a29c5b74830feb47.tar.xz |
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: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/newt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c index 06f248fde5cf..932f12468c3c 100644 --- a/tools/perf/util/newt.c +++ b/tools/perf/util/newt.c @@ -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: |