diff mbox

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

Message ID 1314776773-9560-6-git-send-email-crquan@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cheng Renquan Aug. 31, 2011, 7:46 a.m. UTC
to make it easier to locate begin/end 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(-)

Comments

Nir Tzachar Aug. 31, 2011, 8:42 a.m. UTC | #1
On Wed, Aug 31, 2011 at 10:46 AM, Cheng Renquan <crquan@gmail.com> wrote:
> to make it easier to locate begin/end 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 --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
> index a236ae7..1d73897 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
>
>

Acked By: Nir Tzachar <nir.tzachar@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index a236ae7..1d73897 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' */