diff mbox

[5/5] scripts/kconfig/nconf: add KEY_HOME / KEY_END for dialog_inputbox

Message ID 1314662164-8565-5-git-send-email-crquan@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cheng Renquan Aug. 29, 2011, 11:56 p.m. UTC
to make it better when editing long strings;

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

Patch

diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 62a41d1..909c85f 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -468,6 +468,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' */