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.
This commit is contained in:
Joerg Sonnenberger 2015-09-12 16:37:35 +02:00 committed by Brad King
parent 6c442e5a89
commit da1a02f77f
1 changed files with 6 additions and 7 deletions

View File

@ -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
{