summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesStringWidget.cxx
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2015-09-12 14:37:35 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-16 12:42:20 (GMT)
commitda1a02f77f45781c325f4916851ff42cd90b85d9 (patch)
tree4de9634cdf8d86c6567af04b5c0417551c1cf050 /Source/CursesDialog/cmCursesStringWidget.cxx
parent6c442e5a899e07a85038c4f9c65dfe224ac9485e (diff)
downloadCMake-da1a02f77f45781c325f4916851ff42cd90b85d9.zip
CMake-da1a02f77f45781c325f4916851ff42cd90b85d9.tar.gz
CMake-da1a02f77f45781c325f4916851ff42cd90b85d9.tar.bz2
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/cmCursesStringWidget.cxx')
-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 eaa8739..6eb15c1 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
{