From 23ec3fd1b71be21316678d87be5beeac2c9b2df4 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 25 Feb 2019 14:09:06 -0500 Subject: Add M-a to switch to hot or unread window --- catgirl.1 | 6 ++++-- ui.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/catgirl.1 b/catgirl.1 index 7988e9d..2638d6f 100644 --- a/catgirl.1 +++ b/catgirl.1 @@ -1,4 +1,4 @@ -.Dd February 23, 2019 +.Dd February 25, 2019 .Dt CATGIRL 1 .Os . @@ -300,7 +300,9 @@ Redraw the UI. .It Ic C-n Switch to the next window. .It Ic C-p -Swittch to the previous window. +Switch to the previous window. +.It Ic M-a +Switch to next hot or unread window. .It Ic M-m Insert a blank line in the window. .It Ic M- Ns Ar n diff --git a/ui.c b/ui.c index e31e824..ab519b6 100644 --- a/ui.c +++ b/ui.c @@ -367,6 +367,19 @@ void uiShowNum(int num, bool relative) { uiPrompt(false); } +static void uiShowAuto(void) { + struct Window *unread = NULL; + struct Window *hot; + for (hot = windows.head; hot; hot = hot->next) { + if (hot->hot) break; + if (!unread && hot->unread) unread = hot; + } + if (!hot && !unread) return; + windowShow(hot ? hot : unread); + uiStatus(); + uiPrompt(false); +} + void uiCloseTag(struct Tag tag) { windowClose(windowFor(tag)); uiStatus(); @@ -447,6 +460,7 @@ static void keyCode(wchar_t code) { static void keyMeta(wchar_t ch) { struct Window *win = windows.active; if (ch >= L'0' && ch <= L'9') uiShowNum(ch - L'0', false); + if (ch == L'a') uiShowAuto(); if (!win) return; switch (ch) { break; case L'b': edit(win->tag, EditBackWord, 0); -- cgit 1.4.1 value='committer'>committer
path: root/gzgets.3 (unfollow)
Commit message (Expand)Author
2019-02-19Add READMEJune McEnroe
2019-02-19Remove gitignoreJune McEnroe
2019-02-19Add SEE ALSO, HISTORY and AUTHORS sectionsJune McEnroe
2019-02-19Filter out reference errors from lintJune McEnroe
2019-02-19Replace Makefile with portable oneJune McEnroe
2019-02-19Replace dates with date on header fileJune McEnroe
2018-11-15Add gzerror.3June McEnroe
2018-11-15Add gzclose_* Nm linesJune McEnroe
2018-11-15Add gzclose.3June McEnroe
2018-11-15Add gzdirect.3June McEnroe
2018-11-15Add gzeof.3June McEnroe
2018-11-13Add gzoffset.3June McEnroe
2018-11-13Add gztell(3) to gzseek.3June McEnroe
2018-11-13Add gzseek.3June McEnroe
2018-11-13Add gzflush.3June McEnroe
2018-11-13Fix spacing after parenthetical sentencesJune McEnroe
2018-11-13Add gzungetc.3June McEnroe
2018-11-13Add gzgetc.3June McEnroe
2018-11-13Add gzputc.3June McEnroe
2018-11-13Add gzgets.3June McEnroe
2018-11-13Add gzputs.3June McEnroe
2018-11-13Add gzprintf.3June McEnroe
2018-11-13Add gzfwrite.3June McEnroe
2018-11-13Add gzwrite.3June McEnroe
2018-11-12Add gzfread.3June McEnroe
2018-11-12Add gzread.3June McEnroe
2018-11-12Add gzsetparams.3June McEnroe
2018-11-12Add gzbuffer.3June McEnroe
2018-11-12Add gzdopen to gzopen.3June McEnroe
2018-11-12Add gzopen.3June McEnroe
2018-11-12Add inflateBackEnd.3June McEnroe
2018-11-12Add inflateBack.3June McEnroe
2018-11-12Add inflateBackInit.3June McEnroe
2018-11-11Add inflateGetHeader.3June McEnroe
2018-11-11Add inflateMark.3June McEnroe
2018-11-11Add inflatePrime.3June McEnroe
2018-11-11Add inflateReset.3June McEnroe
2018-11-11Add inflateCopy.3June McEnroe
2018-11-11Add inflateSync.3June McEnroe
2018-11-11Add inflateGetDictionary.3June McEnroe
2018-11-11Add inflateSetDictionary.3June McEnroe
2018-11-11Add inflateInit2.3June McEnroe