From 63f20e744a595444f7ab1d47a29c5b74830feb47 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 15 Jul 2010 07:21:07 -0300 Subject: perf ui: Make END go to the last entry, not the top of the last page Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Stephane Eranian LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/newt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') 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: -- cgit v1.2.2