]> code.delx.au - spectrwm/commitdiff
Move a few spaces to the right place.
authorTiago Cunha <tcunha@gmx.com>
Fri, 18 May 2012 14:04:21 +0000 (15:04 +0100)
committerTiago Cunha <tcunha@gmx.com>
Tue, 5 Jun 2012 21:32:02 +0000 (22:32 +0100)
The format should only be manipulated by the bar_fmt function or the
user. Thus, delete extra space when outputting the window name and move
the strlcat(3) call that appends four spaces where it belongs. Inside
the window title conditional.

Noticed by LordReg.

spectrwm.c

index 09c7ede0b67b5bfc1e90cabcc7ea03567845a935..acbfdedf0cfbd89db802925a69588368acf3ce78 100644 (file)
@@ -1381,7 +1381,6 @@ bar_window_name(char *s, size_t sz, struct swm_region *r)
        if (r->ws->focus->floating)
                strlcat(s, "(f) ", sz);
        strlcat(s, (char *)title, sz);
-       strlcat(s, " ", sz);
 
        XFree(title);
 }
@@ -1467,15 +1466,14 @@ bar_fmt(char *fmtexp, char *fmtnew, struct swm_region *r, size_t sz)
                if (title_class_enabled && r != NULL && r->ws != NULL &&
                    r->ws->focus != NULL)
                        strlcat(fmtnew, ":", sz);
-               strlcat(fmtnew, "+T", sz);
+               strlcat(fmtnew, "+T    ", sz);
        }
 
-       strlcat(fmtnew, "    ", sz);
        if (window_name_enabled)
-               strlcat(fmtnew, "+64W", sz);
+               strlcat(fmtnew, "+64W ", sz);
 
        /* finally add the action script output and the version */
-       strlcat(fmtnew, "     +A    +V", sz);
+       strlcat(fmtnew, "    +A    +V", sz);
 }
 
 /* replaces the bar format character sequences (like in tmux(1)) */