Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libform Fix for PR lib/47398



details:   https://anonhg.NetBSD.org/src/rev/37f1b64012b0
branches:  trunk
changeset: 990058:37f1b64012b0
user:      blymn <blymn%NetBSD.org@localhost>
date:      Mon Oct 25 06:25:18 2021 +0000

description:
Fix for PR lib/47398

Move cursor to end of the currently active field and sync the cursor
location so the cursor get positioned correctly when the form window
is refreshed.

diffstat:

 lib/libform/internals.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r bf764610d1b9 -r 37f1b64012b0 lib/libform/internals.c
--- a/lib/libform/internals.c   Mon Oct 25 02:10:56 2021 +0000
+++ b/lib/libform/internals.c   Mon Oct 25 06:25:18 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: internals.c,v 1.41 2021/10/19 21:22:20 blymn Exp $     */
+/*     $NetBSD: internals.c,v 1.42 2021/10/25 06:25:18 blymn Exp $     */
 
 /*-
  * Copyright (c) 1998-1999 Brett Lymn
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: internals.c,v 1.41 2021/10/19 21:22:20 blymn Exp $");
+__RCSID("$NetBSD: internals.c,v 1.42 2021/10/25 06:25:18 blymn Exp $");
 
 #include <limits.h>
 #include <ctype.h>
@@ -1688,6 +1688,12 @@
        }
 
        wattrset(form->scrwin, cur->back);
+
+       cur = form->fields[form->cur_field];
+       wmove(form->scrwin, cur->form_row + cur->cursor_ypos,
+           cur->form_col + cur->cursor_xpos);
+       wcursyncup(form->scrwin);
+
        return;
 }
 



Home | Main Index | Thread Index | Old Index