summaryrefslogtreecommitdiff
path: root/Source/CursesDialog
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2015-09-12 16:37:35 +0200
committerBrad King <brad.king@kitware.com>2015-09-16 08:42:20 -0400
commitda1a02f77f45781c325f4916851ff42cd90b85d9 (patch)
tree4de9634cdf8d86c6567af04b5c0417551c1cf050 /Source/CursesDialog
parent6c442e5a899e07a85038c4f9c65dfe224ac9485e (diff)
downloadcmake-da1a02f77f45781c325f4916851ff42cd90b85d9.tar.gz
ccmake: Avoid using non-portable 'curcol' field (#15739)
'curcol' is an implementation detail of ncurses so other implementations of 'form' may not have it. The switch-to-previous-field logic only exists for overloaded requests of REQ_DEL_PREV, so no need to check for REQ_DEL_CHAR. For REQ_DEL_PREV, check if the field changed and if it did, change it back.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index eaa8739cbc..6eb15c17aa 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -168,17 +168,16 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
else if ( key == 127 ||
key == KEY_BACKSPACE )
{
- if ( form->curcol > 0 )
- {
+ FIELD *cur = current_field(form);
form_driver(form, REQ_DEL_PREV);
- }
+ if (current_field(form) != cur)
+ {
+ set_current_field(form, cur);
+ }
}
else if ( key == ctrl('d') ||key == KEY_DC )
{
- if ( form->curcol >= 0 )
- {
- form_driver(form, REQ_DEL_CHAR);
- }
+ form_driver(form, REQ_DEL_CHAR);
}
else
{