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:
parent
6c442e5a89
commit
da1a02f77f
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue