From 53f206f7e0a988cfc229a22ba0b929d7cdfcafff Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 24 May 2020 12:34:23 -0400 Subject: Tweak status line formatting --- ui.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/ui.c b/ui.c index 6fe7061..e91bd26 100644 --- a/ui.c +++ b/ui.c @@ -437,23 +437,28 @@ static void statusUpdate(void) { others.unread += window->unreadWarm; if (window->heat > others.heat) others.heat = window->heat; } - int truncUnread, truncScroll; - char buf[256]; - snprintf( - buf, sizeof(buf), "\3%d%s %u%s%s %s %n(\3%02d%d\3%d) %n[%d] ", - idColors[window->id], (num == windows.show ? "\26" : ""), - num, (window->mute ? "=" : ""), (window->ignore ? "" : "-"), - idNames[window->id], - &truncUnread, (window->heat > Warm ? White : idColors[window->id]), - window->unreadWarm, - idColors[window->id], - &truncScroll, window->scroll + char buf[256] = ""; + catf( + buf, sizeof(buf), "\3%d%s %u ", + idColors[window->id], (num == windows.show ? "\26" : ""), num ); - if (!window->scroll) { - buf[truncScroll] = '\0'; - if (!window->mark || !window->unreadWarm) { - buf[truncUnread] = '\0'; - } + if (!window->ignore || window->mute) { + catf( + buf, sizeof(buf), "%s%s ", + &"-"[window->ignore], &"="[!window->mute] + ); + } + catf(buf, sizeof(buf), "%s ", idNames[window->id]); + if (window->mark && window->unreadWarm) { + catf( + buf, sizeof(buf), "\3%d+%d\3%d%s", + (window->heat > Warm ? White : idColors[window->id]), + window->unreadWarm, idColors[window->id], + (window->scroll ? "" : " ") + ); + } + if (window->scroll) { + catf(buf, sizeof(buf), "~%d ", window->scroll); } statusAdd(buf); } @@ -463,14 +468,14 @@ static void statusUpdate(void) { snprintf(title, sizeof(title), "%s %s", network.name, idNames[window->id]); if (window->mark && window->unreadWarm) { catf( - title, sizeof(title), " (%d%s)", - window->unreadWarm, (window->heat > Warm ? "!" : "") + title, sizeof(title), " +%d%s", + window->unreadWarm, &"!"[window->heat < Hot] ); } if (others.unread) { catf( title, sizeof(title), " (+%d%s)", - others.unread, (others.heat > Warm ? "!" : "") + others.unread, &"!"[others.heat < Hot] ); } } -- cgit 1.4.1 d806&showmsg=1&follow=1'>nvim/colors (unfollow)
Commit message (Collapse)Author
2016-02-19Revert "Enable nvim set cursor shape"June McEnroe
This reverts commit 8f202ced239667261d570ce65c6c73ffb030965a. I don't like how thin iTerm renders the line cursor.
2016-02-19Enable nvim set cursor shapeJune McEnroe
2016-02-19Fix rprompt truncationJune McEnroe
2016-02-09Map scroll wheel in nvimJune McEnroe
2016-02-08Always render fonts with thin strokesJune McEnroe
2016-02-06Fix iTerm bold colorJune McEnroe
2016-02-05Disable iTerm transparencyJune McEnroe
2016-02-05Update configurations list in readmeJune McEnroe
2016-02-05Move gitconfigJune McEnroe
2016-02-05Add nvim configurationJune McEnroe
2016-02-04More iTerm configuration tweaksJune McEnroe
2016-02-03Update to iTerm 2.9 betaJune McEnroe
2016-01-31Spawn non-login shells in iTermJune McEnroe
2016-01-28Remove linux gvim aliasJune McEnroe
2016-01-28Rewrite zshrcJune McEnroe
2016-01-28Strip out useless commentsJune McEnroe
2016-01-28Trim tmux configurationJune McEnroe
2016-01-28Remove psql format wrappedJune McEnroe
2016-01-25Wow, that is so annoying, gitJune McEnroe
2016-01-25Clean up .gitconfigJune McEnroe
2016-01-15Remove gitignoreJune McEnroe
2016-01-15Eliminate escape key delay in zshJune McEnroe
2016-01-15Move pretty git log format to .gitconfigJune McEnroe
2016-01-14Remove unused git aliasesJune McEnroe
2016-01-06Hash SSH known hostsJune McEnroe
2015-12-30Ignore directory .swp filesJune McEnroe
2015-12-16Color prompt yellow in vi normal modeJune McEnroe
2015-11-23Remove colorcolumn at 120June McEnroe
2015-11-23Always git rebase --autosquashJune McEnroe
2015-11-18Add inverted shift to KarabinerJune McEnroe
2015-11-06Clean up git configsJune McEnroe
2015-11-06Add prune scriptJune McEnroe
2015-11-03Update vendored Gruvbox colorschemeJune McEnroe
2015-11-02Redefine _newline_precmd in _newline_precmdJune McEnroe
2015-11-02Print newline before every prompt after firstJune McEnroe
2015-11-02Remove first prompt placementJune McEnroe
2015-11-02Newline before prompt and start at bottom of terminalJune McEnroe
2015-10-27Add chruby to zshrcJune McEnroe