ncreader: support Ctrl-B, Ctrl-F for cursor movement #983

This commit is contained in:
nick black 2020-09-08 20:57:49 -04:00
parent d54b322365
commit f8bc3c2ea8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -237,12 +237,21 @@ bool ncreader_offer_input(ncreader* n, const ncinput* ni){
return false;
}
if(ni->ctrl && !n->no_cmd_keys){
if(ni->id == 'U'){
ncplane_erase(n->ncp); // homes the cursor
ncplane_erase(n->textarea);
return true;
switch(ni->id){
case 'U':
ncplane_erase(n->ncp); // homes the cursor
ncplane_erase(n->textarea);
break;
case 'B':
ncreader_move_left(n);
break;
case 'F':
ncreader_move_right(n);
break;
default:
return false; // pass on all other ctrls
}
return false; // pass on all other ctrls
return true;
}
if(ni->id == NCKEY_BACKSPACE){
if(n->textarea->x == 0){