aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Reuße <n.reusse@hxgn.net>2017-03-29 18:34:12 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2017-03-29 18:39:21 +0200
commitf2bfd513b14a2aa27796670235557a550b4189db (patch)
tree806d7a5b5f7611f327bb4aca60af96f2874c6af7
parente7ed326d2e914a57017c9f34459824614075519b (diff)
downloadst-f2bfd513b14a2aa27796670235557a550b4189db.tar.gz
st-f2bfd513b14a2aa27796670235557a550b4189db.tar.bz2
keep some glyph modes for the cursor
st currently does not keep any mode for the cursor that was active in the underlying glyph (e.g. italic text), the mode is always ATTR_NULL [1]. At [2] you can find a screenshot that shows the implications. Other terminals (at least vte-based, such as XFCE-terminal) keep some modes for the cursor. I find the current behaviour very disruptive, so here is a patch that keeps a few (arbitrarily chosen) modes for the cursor. [1] http://git.suckless.org/st/tree/st.c#n3963 [2] http://i.imgur.com/R2yCEaC.png
-rw-r--r--x.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/x.c b/x.c
index 743b084..b7339e9 100644
--- a/x.c
+++ b/x.c
@@ -1266,6 +1266,7 @@ 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);
@@ -1285,6 +1286,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;
/*
* Select the right color for the right mode.