parent
aab9f76fa0
commit
14ae13f781
|
@ -265,6 +265,8 @@ Move to end of line.
|
||||||
Move right.
|
Move right.
|
||||||
.It Ic C-k
|
.It Ic C-k
|
||||||
Delete to end of line.
|
Delete to end of line.
|
||||||
|
.It Ic C-t
|
||||||
|
Transpose characters.
|
||||||
.It Ic C-u
|
.It Ic C-u
|
||||||
Delete to beginning of line.
|
Delete to beginning of line.
|
||||||
.It Ic C-w
|
.It Ic C-w
|
||||||
|
|
1
chat.h
1
chat.h
|
@ -176,6 +176,7 @@ enum Edit {
|
||||||
EditDeletePrevWord,
|
EditDeletePrevWord,
|
||||||
EditDeleteNextWord,
|
EditDeleteNextWord,
|
||||||
EditPaste,
|
EditPaste,
|
||||||
|
EditTranspose,
|
||||||
EditInsert,
|
EditInsert,
|
||||||
EditComplete,
|
EditComplete,
|
||||||
EditEnter,
|
EditEnter,
|
||||||
|
|
9
edit.c
9
edit.c
|
@ -182,6 +182,15 @@ void edit(size_t id, enum Edit op, wchar_t ch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break; case EditTranspose: {
|
||||||
|
if (!pos || len < 2) break;
|
||||||
|
if (pos == len) pos--;
|
||||||
|
wchar_t t = buf[pos];
|
||||||
|
buf[pos] = buf[pos - 1];
|
||||||
|
buf[pos - 1] = t;
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
|
||||||
break; case EditInsert: {
|
break; case EditInsert: {
|
||||||
if (reserve(pos, 1)) {
|
if (reserve(pos, 1)) {
|
||||||
buf[pos++] = ch;
|
buf[pos++] = ch;
|
||||||
|
|
3
ui.c
3
ui.c
|
@ -844,9 +844,10 @@ static void keyCtrl(wchar_t ch) {
|
||||||
break; case L'N': windowShow(windows.active->next);
|
break; case L'N': windowShow(windows.active->next);
|
||||||
break; case L'O': windowShow(windows.other);
|
break; case L'O': windowShow(windows.other);
|
||||||
break; case L'P': windowShow(windows.active->prev);
|
break; case L'P': windowShow(windows.active->prev);
|
||||||
|
break; case L'T': edit(id, EditTranspose, 0);
|
||||||
break; case L'U': edit(id, EditDeleteHead, 0);
|
break; case L'U': edit(id, EditDeleteHead, 0);
|
||||||
break; case L'W': edit(id, EditDeletePrevWord, 0);
|
|
||||||
break; case L'V': windowScroll(windows.active, -(PAGE_LINES - 2));
|
break; case L'V': windowScroll(windows.active, -(PAGE_LINES - 2));
|
||||||
|
break; case L'W': edit(id, EditDeletePrevWord, 0);
|
||||||
break; case L'Y': edit(id, EditPaste, 0);
|
break; case L'Y': edit(id, EditPaste, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue