[hackers] [st] Simplify how we keep ATTRs under cursor || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 4 Apr 2017 18:23:53 +0200 (CEST)

commit 745c40f8b07ab898d1f9d4f564881b40599bc80d
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Apr 4 17:20:55 2017 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Apr 4 18:23:45 2017 +0200

    Simplify how we keep ATTRs under cursor
    
    Thanks to tarug0 for the suggestion/patch.

diff --git a/x.c b/x.c
index b7339e9..fbfd350 100644
--- a/x.c
+++ b/x.c
_AT_@ -1266,7 +1266,6 @@ xdrawcursor(void)
         Glyph g = {' ', ATTR_NULL, defaultbg, defaultcs}, og;
         int ena_sel = sel.ob.x != -1 && sel.alt == IS_SET(MODE_ALTSCREEN);
         Color drawcol;
- unsigned attr;
 
         LIMIT(oldx, 0, term.col-1);
         LIMIT(oldy, 0, term.row-1);
_AT_@ -1286,8 +1285,8 @@ xdrawcursor(void)
         xdrawglyph(og, oldx, oldy);
 
         g.u = term.line[term.c.y][term.c.x].u;
- attr = ATTR_BOLD | ATTR_ITALIC | ATTR_UNDERLINE | ATTR_STRUCK;
- g.mode |= term.line[term.c.y][term.c.x].mode & attr;
+ g.mode |= term.line[term.c.y][term.c.x].mode &
+ (ATTR_BOLD | ATTR_ITALIC | ATTR_UNDERLINE | ATTR_STRUCK);
 
         /*
          * Select the right color for the right mode.
Received on Tue Apr 04 2017 - 18:23:53 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 04 2017 - 18:24:18 CEST