aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2014-08-24 16:27:28 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2014-09-09 05:51:36 +0200
commit0392d165d07143eec29c730364006bc0613e1198 (patch)
treef35f23edc1dd8f5e9b6e1795b5ddf0b47932d8e1
parent98a1085d0e7c3d84e19185ba666c4b0c725cd974 (diff)
downloadst-0392d165d07143eec29c730364006bc0613e1198.tar.gz
st-0392d165d07143eec29c730364006bc0613e1198.tar.bz2
st-0392d165d07143eec29c730364006bc0613e1198.zip
Remove indentation level in xdrawcursor
-rw-r--r--st.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/st.c b/st.c
index 097775d..dd3301b 100644
--- a/st.c
+++ b/st.c
@@ -3459,39 +3459,40 @@ xdrawcursor(void) {
xdraws(term.line[oldy][oldx].c, term.line[oldy][oldx], oldx,
oldy, width, sl);
+ if(IS_SET(MODE_HIDE))
+ return;
+
/* draw the new one */
- if(!(IS_SET(MODE_HIDE))) {
- if(xw.state & WIN_FOCUSED) {
- if(IS_SET(MODE_REVERSE)) {
- g.mode |= ATTR_REVERSE;
- g.fg = defaultcs;
- g.bg = defaultfg;
- }
+ if(xw.state & WIN_FOCUSED) {
+ if(IS_SET(MODE_REVERSE)) {
+ g.mode |= ATTR_REVERSE;
+ g.fg = defaultcs;
+ g.bg = defaultfg;
+ }
- sl = utf8len(g.c);
- width = (term.line[term.c.y][curx].mode & ATTR_WIDE)\
- ? 2 : 1;
- xdraws(g.c, g, term.c.x, term.c.y, width, sl);
- } else {
- XftDrawRect(xw.draw, &dc.col[defaultcs],
- borderpx + curx * xw.cw,
- borderpx + term.c.y * xw.ch,
- xw.cw - 1, 1);
- XftDrawRect(xw.draw, &dc.col[defaultcs],
- borderpx + curx * xw.cw,
- borderpx + term.c.y * xw.ch,
- 1, xw.ch - 1);
- XftDrawRect(xw.draw, &dc.col[defaultcs],
- borderpx + (curx + 1) * xw.cw - 1,
- borderpx + term.c.y * xw.ch,
- 1, xw.ch - 1);
- XftDrawRect(xw.draw, &dc.col[defaultcs],
- borderpx + curx * xw.cw,
- borderpx + (term.c.y + 1) * xw.ch - 1,
- xw.cw, 1);
- }
- oldx = curx, oldy = term.c.y;
- }
+ sl = utf8len(g.c);
+ width = (term.line[term.c.y][curx].mode & ATTR_WIDE)\
+ ? 2 : 1;
+ xdraws(g.c, g, term.c.x, term.c.y, width, sl);
+ } else {
+ XftDrawRect(xw.draw, &dc.col[defaultcs],
+ borderpx + curx * xw.cw,
+ borderpx + term.c.y * xw.ch,
+ xw.cw - 1, 1);
+ XftDrawRect(xw.draw, &dc.col[defaultcs],
+ borderpx + curx * xw.cw,
+ borderpx + term.c.y * xw.ch,
+ 1, xw.ch - 1);
+ XftDrawRect(xw.draw, &dc.col[defaultcs],
+ borderpx + (curx + 1) * xw.cw - 1,
+ borderpx + term.c.y * xw.ch,
+ 1, xw.ch - 1);
+ XftDrawRect(xw.draw, &dc.col[defaultcs],
+ borderpx + curx * xw.cw,
+ borderpx + (term.c.y + 1) * xw.ch - 1,
+ xw.cw, 1);
+ }
+ oldx = curx, oldy = term.c.y;
}