lkml.org 
[lkml]   [2011]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V3 5/5] scripts/kconfig/nconf: add KEY_HOME / KEY_END for dialog_inputbox
Date
From: Cheng Renquan <crquan@gmail.com>

to make it easier to locate begin/end when editing long strings;

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Acked By: Nir Tzachar <nir.tzachar@gmail.com>
---
scripts/kconfig/nconf.gui.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 4b9d8b6..3b18dd8 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -465,6 +465,14 @@ int dialog_inputbox(WINDOW *main_window,
cursor_form_win--;
}
break;
+ case KEY_HOME:
+ cursor_position = 0;
+ cursor_form_win = 0;
+ break;
+ case KEY_END:
+ cursor_position = len;
+ cursor_form_win = min(cursor_position, prompt_width-1);
+ break;
default:
if ((isgraph(res) || isspace(res))) {
/* one for new char, one for '\0' */
--
1.7.6


\
 
 \ /
  Last update: 2011-09-01 19:55    [W:0.120 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site