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,13 +237,22 @@ bool ncreader_offer_input(ncreader* n, const ncinput* ni){
return false; return false;
} }
if(ni->ctrl && !n->no_cmd_keys){ if(ni->ctrl && !n->no_cmd_keys){
if(ni->id == 'U'){ switch(ni->id){
case 'U':
ncplane_erase(n->ncp); // homes the cursor ncplane_erase(n->ncp); // homes the cursor
ncplane_erase(n->textarea); ncplane_erase(n->textarea);
return true; 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(ni->id == NCKEY_BACKSPACE){
if(n->textarea->x == 0){ if(n->textarea->x == 0){
if(n->textarea->y){ if(n->textarea->y){