summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c6
1 files changed, 6 insertions, 0 deletions
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();
emeJune McEnroe 2013-03-26Replace nerdcommenter with vim-commentaryJune McEnroe 2013-03-24Add paredit.vimJune McEnroe 2013-03-14Update base16-vimJune McEnroe It's still crap 2013-03-12Hide mode from below statuslineJune McEnroe 2013-03-12Switch to powerlineJune McEnroe Which I'm not going to bother configuring because it thinks it's all fancy and for other things that aren't Vim so it stores its config file in ~/.config which I keep in a different repo and I only want to use it for Vim so fuck you, Powerline. </rant> 2013-03-12Remove vim-powerlineJune McEnroe 2013-02-03Update base16 and refheapJune McEnroe 2013-02-03Ignore plugin/private.vimJune McEnroe 2012-09-29Disable GUI dialogsJune McEnroe