perf map browser: Exit just on well known key presses

Initial motivation was to avoid the confusing exit when when '/' is
pressed in non verbose mode, as specified in the help line searches
are only available in verbose mode.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-20xezxim2y4agmkx7f3sucll@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 6692c262
...@@ -80,12 +80,20 @@ static int map_browser__run(struct map_browser *self) ...@@ -80,12 +80,20 @@ static int map_browser__run(struct map_browser *self)
while (1) { while (1) {
key = ui_browser__run(&self->b, 0); key = ui_browser__run(&self->b, 0);
if (verbose && key == '/') switch (key) {
map_browser__search(self); case '/':
else if (verbose)
map_browser__search(self);
default:
break; break;
case K_LEFT:
case K_ESC:
case 'q':
case CTRL('c'):
goto out;
}
} }
out:
ui_browser__hide(&self->b); ui_browser__hide(&self->b);
return key; return key;
} }
......
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