summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--catgirl.12
-rw-r--r--ui.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/catgirl.1 b/catgirl.1
index 4571162..57b5cd4 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -445,6 +445,8 @@ Switch to previously selected window.
 Switch to previous window.
 .It Ic C-v
 Scroll down a page.
+.It Ic M--
+Toggle visibility of filtered messages.
 .It Ic M-/
 Switch to previously selected window.
 .It Ic M-a
diff --git a/ui.c b/ui.c
index c91ca04..3e9b95d 100644
--- a/ui.c
+++ b/ui.c
@@ -87,6 +87,7 @@ struct Window {
 	WINDOW *pad;
 	int scroll;
 	bool mark;
+	bool ignore;
 	enum Heat heat;
 	uint unread;
 	uint unreadWarm;
@@ -146,6 +147,7 @@ static uint windowFor(uint id) {
 	scrollok(window->pad, true);
 	wmove(window->pad, WindowLines - 1, 0);
 	window->mark = true;
+	window->ignore = true;
 
 	return windowPush(window);
 }
@@ -211,6 +213,7 @@ static short colorPair(short fg, short bg) {
 	X(KeyMetaU, "\33u", NULL) \
 	X(KeyMetaV, "\33v", NULL) \
 	X(KeyMetaEnter, "\33\r", "\33\n") \
+	X(KeyMetaMinus, "\33-", "\33_") \
 	X(KeyMetaSlash, "\33/", NULL) \
 	X(KeyFocusIn, "\33[I", NULL) \
 	X(KeyFocusOut, "\33[O", NULL) \
@@ -587,6 +590,7 @@ void uiWrite(uint id, enum Heat heat, const time_t *src, const char *str) {
 	struct Window *window = windows.ptrs[windowFor(id)];
 	time_t ts = (src ? *src : time(NULL));
 	bufferPush(&window->buffer, heat, ts, str);
+	if (heat < Cold && window->ignore) return;
 
 	int lines = 0;
 	window->unread++;
@@ -630,6 +634,7 @@ static void reflow(struct Window *window) {
 	for (size_t i = 0; i < BufferCap; ++i) {
 		struct Line line = bufferLine(&window->buffer, i);
 		if (!line.str) continue;
+		if (line.heat < Cold && window->ignore) continue;
 		int lines = wordWrap(window->pad, line.str);
 		if (i >= (size_t)(BufferCap - window->unread)) {
 			window->unreadLines += lines;
@@ -867,6 +872,7 @@ static void keyCode(int code) {
 		break; case KeyFocusOut: mark(window);
 
 		break; case KeyMetaEnter: edit(id, EditInsert, L'\n');
+		break; case KeyMetaMinus: window->ignore ^= true; reflow(window);
 		break; case KeyMetaSlash: windowShow(windows.swap);
 
 		break; case KeyMetaA: showAuto();
-0400'>2017-07-04Reorganize neovim configuration, againJune McEnroe 2017-07-04Remove <Esc><Esc> terminal mappingJune McEnroe <C-w><Esc> works just as well. Convenient. 2017-07-04Generalize C-w neovim terminal mappingJune McEnroe 2017-07-04Remove tmuxJune McEnroe tmux configuration was starting to bother me, and it got worse with Sierra. Turns out that neovim terminal emulation is much more natural to work with and requires less configuration, though I still disapprove of the feature being included in an editor! For detaching and attaching sessions, abduco is a simple tool that seems to work decently, but given that I will likely only be running neovim in the sessions, I might come up with something even simpler. 2017-07-04Show terminal title in statuslineJune McEnroe 2017-07-04Add nvim terminal mappingsJune McEnroe 2017-06-29Add color to xxJune McEnroe 2017-06-28Set tmux copy-mode-vi bindings for TarmakJune McEnroe 2017-06-27Link Scala syntax fileJune McEnroe Oops. 2017-06-27Clean up top of trivial colorscheme fileJune McEnroe 2017-06-27Fix Scala syntax highlight linksJune McEnroe