rline_exp: ^K, ^U, visual indicator for ^V

This commit is contained in:
K. Lange 2018-10-05 22:46:56 +09:00
parent 462192cde4
commit 1870bdbdc2

View File

@ -1490,6 +1490,8 @@ static int read_line(void) {
return 1; return 1;
case 22: /* ^V */ case 22: /* ^V */
/* Don't bother with unicode, just take the next byte */ /* Don't bother with unicode, just take the next byte */
place_cursor_actual();
printf("^\b");
insert_char(getc(stdin)); insert_char(getc(stdin));
immediate = 0; immediate = 0;
break; break;
@ -1502,6 +1504,16 @@ static int read_line(void) {
render_line(); render_line();
place_cursor_actual(); place_cursor_actual();
break; break;
case 11: /* ^K - Clear to end */
the_line->actual = column;
immediate = 0;
break;
case 21: /* ^U - Kill to beginning */
while (column) {
delete_at_cursor();
}
immediate = 0;
break;
case '\t': case '\t':
if (tab_complete_func) { if (tab_complete_func) {
/* Tab complete */ /* Tab complete */