From e7bfdb237612072506938d5ae7578f7c1fd4cbff Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 3 Oct 2019 14:40:23 -0400 Subject: Add C-u and move underline to C-_ --- catgirl.1 | 8 +++++--- chat.h | 3 ++- edit.c | 3 ++- ui.c | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/catgirl.1 b/catgirl.1 index f0f1422..5511ed4 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -1,4 +1,4 @@ -.Dd September 16, 2019 +.Dd October 3, 2019 .Dt CATGIRL 1 .Os . @@ -254,6 +254,8 @@ Move cursor to end of line. Move cursor right. .It Ic C-k Delete line after cursor. +.It Ic C-u +Delete line. .It Ic C-w Delete word before cursor. .It Ic M-b @@ -269,6 +271,8 @@ commands, nicks and channels. . .Ss IRC Formatting .Bl -tag -width Ds -compact +.It Ic C-_ +Toggle underline. .It Ic C-o Toggle bold. .It Ic C-r @@ -277,8 +281,6 @@ Set or reset color. Reset formatting. .It Ic C-t Toggle italics. -.It Ic C-u -Toggle underline. .It Ic C-v Toggle reverse video. This must usually be typed as diff --git a/chat.h b/chat.h index e33ea2f..61d8a96 100644 --- a/chat.h +++ b/chat.h @@ -165,9 +165,10 @@ enum Edit { EditInsert, EditBackspace, EditDelete, + EditKill, EditKillBackWord, EditKillForeWord, - EditKillLine, + EditKillEnd, EditComplete, EditEnter, }; diff --git a/edit.c b/edit.c index 99dc929..c63e4a2 100644 --- a/edit.c +++ b/edit.c @@ -172,9 +172,10 @@ void edit(struct Tag tag, enum Edit op, wchar_t ch) { break; case EditBackspace: reject(); backspace(); break; case EditDelete: reject(); delete(); + break; case EditKill: reject(); line.ptr = line.end = line.buf; break; case EditKillBackWord: reject(); killBackWord(); 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); diff --git a/ui.c b/ui.c index 1273028..9cf21d3 100644 --- a/ui.c +++ b/ui.c @@ -515,7 +515,8 @@ static void keyChar(wchar_t ch) { break; case CTRL(L'D'): edit(win->tag, EditDelete, 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'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'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'S'): edit(win->tag, EditInsert, IRCReset); 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'_'): edit(win->tag, EditInsert, IRCUnderline); break; case L'\b': edit(win->tag, EditBackspace, 0); break; case L'\t': edit(win->tag, EditComplete, 0); -- cgit 1.4.1-2-gfad0