mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-01 00:51:19 +00:00
cons/dietline: move to next/prev word with ESCf/b and clear line with ^K
This commit is contained in:
parent
e6c40aa520
commit
c4bfa3ec95
@ -979,7 +979,9 @@ R_API const char *r_line_readline_cb(RLineReadCallback cb, void *user) {
|
||||
break;
|
||||
case 10: // ^J -- ignore
|
||||
return I.buffer.data;
|
||||
case 11: // ^K -- ignore
|
||||
case 11: // ^K
|
||||
I.buffer.data[I.buffer.index] = '\0';
|
||||
I.buffer.length = I.buffer.index;
|
||||
break;
|
||||
case 6: // ^f // emacs right
|
||||
#if USE_UTF8
|
||||
@ -1080,6 +1082,7 @@ R_API const char *r_line_readline_cb(RLineReadCallback cb, void *user) {
|
||||
I.buffer.index = I.buffer.length;
|
||||
break;
|
||||
case 'B':
|
||||
case 'b':
|
||||
// previous word
|
||||
for (i = I.buffer.index - 2; i >= 0; i--) {
|
||||
if (I.buffer.data[i] == ' ' && I.buffer.data[i + 1] != ' ') {
|
||||
@ -1091,6 +1094,7 @@ R_API const char *r_line_readline_cb(RLineReadCallback cb, void *user) {
|
||||
I.buffer.index = 0;
|
||||
break;
|
||||
case 'F':
|
||||
case 'f':
|
||||
// next word
|
||||
for (i = I.buffer.index + 1; i < I.buffer.length; i++) {
|
||||
if (I.buffer.data[i] != ' ' && I.buffer.data[i - 1] == ' ') {
|
||||
|
Loading…
Reference in New Issue
Block a user