Add C-u and move underline to C-_

master
Curtis McEnroe 2019-10-03 14:40:23 -04:00
parent 5cf4beec7a
commit e7bfdb2376
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
4 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,4 @@
.Dd September 16, 2019 .Dd October 3, 2019
.Dt CATGIRL 1 .Dt CATGIRL 1
.Os .Os
. .
@ -254,6 +254,8 @@ Move cursor to end of line.
Move cursor right. Move cursor right.
.It Ic C-k .It Ic C-k
Delete line after cursor. Delete line after cursor.
.It Ic C-u
Delete line.
.It Ic C-w .It Ic C-w
Delete word before cursor. Delete word before cursor.
.It Ic M-b .It Ic M-b
@ -269,6 +271,8 @@ commands, nicks and channels.
. .
.Ss IRC Formatting .Ss IRC Formatting
.Bl -tag -width Ds -compact .Bl -tag -width Ds -compact
.It Ic C-_
Toggle underline.
.It Ic C-o .It Ic C-o
Toggle bold. Toggle bold.
.It Ic C-r .It Ic C-r
@ -277,8 +281,6 @@ Set or reset color.
Reset formatting. Reset formatting.
.It Ic C-t .It Ic C-t
Toggle italics. Toggle italics.
.It Ic C-u
Toggle underline.
.It Ic C-v .It Ic C-v
Toggle reverse video. Toggle reverse video.
This must usually be typed as This must usually be typed as

3
chat.h
View File

@ -165,9 +165,10 @@ enum Edit {
EditInsert, EditInsert,
EditBackspace, EditBackspace,
EditDelete, EditDelete,
EditKill,
EditKillBackWord, EditKillBackWord,
EditKillForeWord, EditKillForeWord,
EditKillLine, EditKillEnd,
EditComplete, EditComplete,
EditEnter, EditEnter,
}; };

3
edit.c
View File

@ -172,9 +172,10 @@ void edit(struct Tag tag, enum Edit op, wchar_t ch) {
break; case EditBackspace: reject(); backspace(); break; case EditBackspace: reject(); backspace();
break; case EditDelete: reject(); delete(); break; case EditDelete: reject(); delete();
break; case EditKill: reject(); line.ptr = line.end = line.buf;
break; case EditKillBackWord: reject(); killBackWord(); break; case EditKillBackWord: reject(); killBackWord();
break; case EditKillForeWord: reject(); killForeWord(); break; case EditKillForeWord: reject(); killForeWord();
break; case EditKillLine: reject(); line.end = line.ptr; break; case EditKillEnd: reject(); line.end = line.ptr;
break; case EditComplete: complete(tag); break; case EditComplete: complete(tag);

5
ui.c
View File

@ -515,7 +515,8 @@ static void keyChar(wchar_t ch) {
break; case CTRL(L'D'): edit(win->tag, EditDelete, 0); break; case CTRL(L'D'): edit(win->tag, EditDelete, 0);
break; case CTRL(L'E'): edit(win->tag, EditEnd, 0); break; case CTRL(L'E'): edit(win->tag, EditEnd, 0);
break; case CTRL(L'F'): edit(win->tag, EditRight, 0); break; case CTRL(L'F'): edit(win->tag, EditRight, 0);
break; case CTRL(L'K'): edit(win->tag, EditKillLine, 0); break; case CTRL(L'K'): edit(win->tag, EditKillEnd, 0);
break; case CTRL(L'U'): edit(win->tag, EditKill, 0);
break; case CTRL(L'W'): edit(win->tag, EditKillBackWord, 0); break; case CTRL(L'W'): edit(win->tag, EditKillBackWord, 0);
break; case CTRL(L'C'): edit(win->tag, EditInsert, IRCColor); break; case CTRL(L'C'): edit(win->tag, EditInsert, IRCColor);
@ -523,8 +524,8 @@ static void keyChar(wchar_t ch) {
break; case CTRL(L'R'): edit(win->tag, EditInsert, IRCColor); break; case CTRL(L'R'): edit(win->tag, EditInsert, IRCColor);
break; case CTRL(L'S'): edit(win->tag, EditInsert, IRCReset); break; case CTRL(L'S'): edit(win->tag, EditInsert, IRCReset);
break; case CTRL(L'T'): edit(win->tag, EditInsert, IRCItalic); break; case CTRL(L'T'): edit(win->tag, EditInsert, IRCItalic);
break; case CTRL(L'U'): edit(win->tag, EditInsert, IRCUnderline);
break; case CTRL(L'V'): edit(win->tag, EditInsert, IRCReverse); break; case CTRL(L'V'): edit(win->tag, EditInsert, IRCReverse);
break; case CTRL(L'_'): edit(win->tag, EditInsert, IRCUnderline);
break; case L'\b': edit(win->tag, EditBackspace, 0); break; case L'\b': edit(win->tag, EditBackspace, 0);
break; case L'\t': edit(win->tag, EditComplete, 0); break; case L'\t': edit(win->tag, EditComplete, 0);