From 6b315558f8095b91988d5b305ed06e082da48889 Mon Sep 17 00:00:00 2001 From: noname Date: Tue, 29 Apr 2014 02:35:22 +0400 Subject: [PATCH 01/16] Do not save cursor in tresize. This patch fixes the bug introduced in 8f11e1cd034ff28ca47bb4955505db7fa8016ba8 To reproduce the bug: 1. Save cursor: printf '\e[s' 2. Load cursor: printf '\e[u' 3. Resize st window. 4. Load cursor again: printf '\e[u' --- st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st.c b/st.c index 5198749..c50a202 100644 --- a/st.c +++ b/st.c @@ -2634,6 +2634,7 @@ tresize(int col, int row) { int slide = term.c.y - row + 1; bool *bp; Line *orig; + TCursor c; if(col < 1 || row < 1) return 0; @@ -2695,6 +2696,7 @@ tresize(int col, int row) { tmoveto(term.c.x, term.c.y); /* Clearing both screens */ orig = term.line; + c = term.c; do { if(mincol < col && 0 < minrow) { tclearregion(mincol, 0, col - 1, minrow - 1); @@ -2702,10 +2704,10 @@ tresize(int col, int row) { if(0 < col && minrow < row) { tclearregion(0, minrow, col - 1, row - 1); } - tcursor(CURSOR_SAVE); tswapscreen(); tcursor(CURSOR_LOAD); } while(orig != term.line); + term.c = c; return (slide > 0); } -- 2.20.1 From 1629363f2d009a0c0d61209e4126ff09fa0e11a4 Mon Sep 17 00:00:00 2001 From: "Roberto E. Vargas Caballero" Date: Tue, 29 Apr 2014 08:58:10 +0200 Subject: [PATCH 02/16] Remove ATTR_GFX and tselcs ATTR_GFX was used long time ago to detect when terminal was in graphic mode. Today graphic mode is implemented using a charset pointer, so ATTR_GFX is not needed anymore because graphic condition can be detected directly checking if current charset is GRAPHICS C0. --- st.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/st.c b/st.c index c50a202..3ed77e1 100644 --- a/st.c +++ b/st.c @@ -94,12 +94,11 @@ enum glyph_attribute { ATTR_REVERSE = 1, ATTR_UNDERLINE = 2, ATTR_BOLD = 4, - ATTR_GFX = 8, - ATTR_ITALIC = 16, - ATTR_BLINK = 32, - ATTR_WRAP = 64, - ATTR_WIDE = 128, - ATTR_WDUMMY = 256, + ATTR_ITALIC = 8, + ATTR_BLINK = 16, + ATTR_WRAP = 32, + ATTR_WIDE = 64, + ATTR_WDUMMY = 128, }; enum cursor_movement { @@ -396,7 +395,6 @@ static void techo(char *, int); static bool tcontrolcode(uchar ); static void tdectest(char ); static int32_t tdefcolor(int *, int *, int); -static void tselcs(void); static void tdeftran(char); static inline bool match(uint, uint); static void ttynew(void); @@ -1535,7 +1533,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) { /* * The table is proudly stolen from rxvt. */ - if(attr->mode & ATTR_GFX) { + if(term.trantbl[term.charset] == CS_GRAPHIC0) { if(BETWEEN(c[0], 0x41, 0x7e) && vt100_0[c[0] - 0x41]) { c = vt100_0[c[0] - 0x41]; } @@ -2317,9 +2315,7 @@ void tdeftran(char ascii) { char c, (*bp)[2]; static char tbl[][2] = { - {'0', CS_GRAPHIC0}, {'1', CS_GRAPHIC1}, {'A', CS_UK}, - {'B', CS_USA}, {'<', CS_MULTI}, {'K', CS_GER}, - {'5', CS_FIN}, {'C', CS_FIN}, + {'0', CS_GRAPHIC0}, {'B', CS_USA}, {0, 0} }; @@ -2332,13 +2328,6 @@ tdeftran(char ascii) { term.trantbl[term.icharset] = (*bp)[1]; } -void -tselcs(void) { - MODBIT(term.c.attr.mode, - term.trantbl[term.charset] == CS_GRAPHIC0, - ATTR_GFX); -} - bool tcontrolcode(uchar ascii) { static char question[UTF_SIZ] = "?"; @@ -2377,11 +2366,9 @@ tcontrolcode(uchar ascii) { return 1; case '\016': /* SO */ term.charset = 0; - tselcs(); break; case '\017': /* SI */ term.charset = 1; - tselcs(); break; case '\032': /* SUB */ tsetchar(question, &term.c.attr, term.c.x, term.c.y); @@ -2506,7 +2493,6 @@ tputc(char *c, int len) { return; } else if(term.esc & ESC_ALTCHARSET) { tdeftran(ascii); - tselcs(); } else if(term.esc & ESC_TEST) { tdectest(ascii); } else { @@ -2593,7 +2579,7 @@ tputc(char *c, int len) { /* * Display control codes only if we are in graphic mode */ - if(control && !(term.c.attr.mode & ATTR_GFX)) + if(control && term.trantbl[term.charset] != CS_GRAPHIC0) return; if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y)) selclear(NULL); -- 2.20.1 From 870f961c49d3f9dfea8d78666e73fcdd0f90cc57 Mon Sep 17 00:00:00 2001 From: "Roberto E. Vargas Caballero" Date: Tue, 29 Apr 2014 09:58:55 +0200 Subject: [PATCH 03/16] Fix displaying control code Control code are never displayed. It is not important if graphic charset is displayed or not. --- st.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/st.c b/st.c index 3ed77e1..7474256 100644 --- a/st.c +++ b/st.c @@ -392,7 +392,7 @@ static void tsetdirtattr(int); static void tsetmode(bool, bool, int *, int); static void tfulldirt(void); static void techo(char *, int); -static bool tcontrolcode(uchar ); +static void tcontrolcode(uchar ); static void tdectest(char ); static int32_t tdefcolor(int *, int *, int); static void tdeftran(char); @@ -2328,7 +2328,7 @@ tdeftran(char ascii) { term.trantbl[term.icharset] = (*bp)[1]; } -bool +void tcontrolcode(uchar ascii) { static char question[UTF_SIZ] = "?"; @@ -2363,7 +2363,7 @@ tcontrolcode(uchar ascii) { csireset(); term.esc &= ~(ESC_CSI|ESC_ALTCHARSET|ESC_TEST); term.esc |= ESC_START; - return 1; + return; case '\016': /* SO */ term.charset = 0; break; @@ -2395,11 +2395,9 @@ tcontrolcode(uchar ascii) { case 0x9e: /* TODO: PM */ case 0x9f: /* TODO: APC */ break; - default: - return 0; } term.esc &= ~(ESC_STR_END|ESC_STR); - return 1; + return; } void @@ -2478,8 +2476,11 @@ tputc(char *c, int len) { * they must not cause conflicts with sequences. */ if(control) { - if (tcontrolcode(ascii)) - return; + tcontrolcode(ascii); + /* + * control codes are not shown ever + */ + return; } else if(term.esc & ESC_START) { if(term.esc & ESC_CSI) { csiescseq.buf[csiescseq.len++] = ascii; @@ -2576,11 +2577,6 @@ tputc(char *c, int len) { */ return; } - /* - * Display control codes only if we are in graphic mode - */ - if(control && term.trantbl[term.charset] != CS_GRAPHIC0) - return; if(sel.ob.x != -1 && BETWEEN(term.c.y, sel.ob.y, sel.oe.y)) selclear(NULL); -- 2.20.1 From 99fb365aa30e6d9f8fa035f4d2adbc3145fafb00 Mon Sep 17 00:00:00 2001 From: noname Date: Fri, 25 Apr 2014 18:26:54 +0400 Subject: [PATCH 04/16] Consistent FALLTHROUGH comments. --- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index 7474256..fe44608 100644 --- a/st.c +++ b/st.c @@ -1837,7 +1837,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { if (!allowaltscreen) break; tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); - /* FALLTHRU */ + /* FALLTHROUGH */ case 47: /* swap screen */ case 1047: if (!allowaltscreen) @@ -1851,7 +1851,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { tswapscreen(); if(*args != 1049) break; - /* FALLTRU */ + /* FALLTHROUGH */ case 1048: tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); break; @@ -2146,7 +2146,7 @@ strhandle(void) { if(narg < 3) break; p = strescseq.args[2]; - /* fall through */ + /* FALLTHROUGH */ case 104: /* color reset, here p = NULL */ j = (narg > 1) ? atoi(strescseq.args[1]) : -1; if (!xsetcolorname(j, p)) { -- 2.20.1 From 5e917ab2874de556de12ce43e9a97300c9c722a2 Mon Sep 17 00:00:00 2001 From: Colona Date: Wed, 7 May 2014 10:05:27 +0200 Subject: [PATCH 05/16] Also clears ESC_START on interrupt characters during sequences. Otherwise, the rest of the input is interpreted as a new escape sequence. For the ESC character, ESC_START is re-set in tcontrolcode. --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index fe44608..baab589 100644 --- a/st.c +++ b/st.c @@ -2446,7 +2446,7 @@ tputc(char *c, int len) { (ascii == '\a' || ascii == 030 || ascii == 032 || ascii == 033 || ISCONTROLC1(unicodep))) { - term.esc &= ~ESC_STR; + term.esc &= ~(ESC_START|ESC_STR); term.esc |= ESC_STR_END; } else if(strescseq.len + len < sizeof(strescseq.buf) - 1) { memmove(&strescseq.buf[strescseq.len], c, len); -- 2.20.1 From e31829f659a818e438bf2fe45708abb2983f8765 Mon Sep 17 00:00:00 2001 From: Colona Date: Fri, 9 May 2014 10:23:53 +0200 Subject: [PATCH 06/16] End a sequence only on CAN, SUB, \a and C1s. --- st.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/st.c b/st.c index baab589..fd872c1 100644 --- a/st.c +++ b/st.c @@ -2335,19 +2335,19 @@ tcontrolcode(uchar ascii) { switch(ascii) { case '\t': /* HT */ tputtab(1); - break; + return; case '\b': /* BS */ tmoveto(term.c.x-1, term.c.y); - break; + return; case '\r': /* CR */ tmoveto(0, term.c.y); - break; + return; case '\f': /* LF */ case '\v': /* VT */ case '\n': /* LF */ /* go to first col if the mode is set */ tnewline(IS_SET(MODE_CRLF)); - break; + return; case '\a': /* BEL */ if(term.esc & ESC_STR_END) { /* backwards compatibility to xterm */ @@ -2366,10 +2366,10 @@ tcontrolcode(uchar ascii) { return; case '\016': /* SO */ term.charset = 0; - break; + return; case '\017': /* SI */ term.charset = 1; - break; + return; case '\032': /* SUB */ tsetchar(question, &term.c.attr, term.c.x, term.c.y); case '\030': /* CAN */ @@ -2380,6 +2380,7 @@ tcontrolcode(uchar ascii) { case '\021': /* XON (IGNORED) */ case '\023': /* XOFF (IGNORED) */ case 0177: /* DEL (IGNORED) */ + return; case 0x84: /* TODO: IND */ case 0x85: /* TODO: NEL */ case 0x88: /* TODO: HTS */ @@ -2396,6 +2397,7 @@ tcontrolcode(uchar ascii) { case 0x9f: /* TODO: APC */ break; } + /* only CAN, SUB, \a and C1 chars interrupt a sequence */ term.esc &= ~(ESC_STR_END|ESC_STR); return; } -- 2.20.1 From bdb850a16a6d7a2d12b2bd5500a3b7d70290a74a Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Fri, 9 May 2014 17:12:58 +0200 Subject: [PATCH 07/16] Redraw needs all dirty lines to have flash etc. work. --- st.c | 1 + 1 file changed, 1 insertion(+) diff --git a/st.c b/st.c index fd872c1..5946c7c 100644 --- a/st.c +++ b/st.c @@ -3439,6 +3439,7 @@ void redraw(int timeout) { struct timespec tv = {0, timeout * 1000}; + tfulldirt(); draw(); if(timeout > 0) { -- 2.20.1 From cf890e5bf06a65a35fe195aa1ef8ae3e1eb55f51 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 12 May 2014 14:39:37 +0200 Subject: [PATCH 08/16] Allow mouse selection override using ShiftMask Similar to xterm or urxvt holding shift before selecting text with the mouse allows to override copying text. For example in tmux with "mode-mouse on" or vim (compiled with --with-x), mc, htop, etc. forceselmod in config.h sets the modifier to use this mode, by default ShiftMask. Signed-off-by: Hiltjo Posthuma --- config.def.h | 6 +++++- st.c | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index 646a88a..6e2be9a 100644 --- a/config.def.h +++ b/config.def.h @@ -154,6 +154,11 @@ static KeySym mappedkeys[] = { -1 }; */ static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; +/* Override mouse-select while mask is active (when MODE_MOUSE is set). + * Note that if you want to use ShiftMask with selmasks, set this to an other + * modifier, set to 0 to not use it. */ +static uint forceselmod = ShiftMask; + static Key key[] = { /* keysym mask string appkey appcursor crlf */ { XK_KP_Home, ShiftMask, "\033[2J", 0, -1, 0}, @@ -357,7 +362,6 @@ static Key key[] = { * ButtonRelease and MotionNotify. * If no match is found, regular selection is used. */ - static uint selmasks[] = { [SEL_RECTANGULAR] = Mod1Mask, }; diff --git a/st.c b/st.c index 5946c7c..78d8a01 100644 --- a/st.c +++ b/st.c @@ -765,7 +765,7 @@ selsnap(int mode, int *x, int *y, int direction) { void getbuttoninfo(XEvent *e) { int type; - uint state = e->xbutton.state &~Button1Mask; + uint state = e->xbutton.state & ~(Button1Mask | forceselmod); sel.alt = IS_SET(MODE_ALTSCREEN); @@ -858,7 +858,7 @@ bpress(XEvent *e) { struct timeval now; Mousekey *mk; - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } @@ -1090,7 +1090,7 @@ xsetsel(char *str) { void brelease(XEvent *e) { - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } @@ -1113,7 +1113,7 @@ void bmotion(XEvent *e) { int oldey, oldex, oldsby, oldsey; - if(IS_SET(MODE_MOUSE)) { + if(IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { mousereport(e); return; } -- 2.20.1 From 3544e354b2dcdfcced1a2f4aeedb4d479abd543c Mon Sep 17 00:00:00 2001 From: FRIGN Date: Thu, 22 May 2014 15:00:33 +0200 Subject: [PATCH 09/16] Fix colour-model and simplify xloadcols() Signed-off-by: Christoph Lohmann <20h@r-36.net> --- st.c | 56 ++++++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/st.c b/st.c index 78d8a01..a6b4ada 100644 --- a/st.c +++ b/st.c @@ -340,7 +340,7 @@ typedef struct { /* Drawing Context */ typedef struct { - Colour col[LEN(colorname) < 256 ? 256 : LEN(colorname)]; + Colour col[MAX(LEN(colorname), 256)]; Font font, bfont, ifont, ibfont; GC gc; } DC; @@ -2715,7 +2715,7 @@ sixd_to_16bit(int x) { void xloadcols(void) { - int i, r, g, b; + int i; XRenderColor color = { .alpha = 0xffff }; static bool loaded; Colour *cp; @@ -2725,7 +2725,7 @@ xloadcols(void) { XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); } - /* load colors [0-15] colors and [256-LEN(colorname)[ (config.h) */ + /* load colours [0-15] and [256-LEN(colorname)] (config.h) */ for(i = 0; i < LEN(colorname); i++) { if(!colorname[i]) continue; @@ -2734,27 +2734,20 @@ xloadcols(void) { } } - /* load colors [16-255] ; same colors as xterm */ - for(i = 16, r = 0; r < 6; r++) { - for(g = 0; g < 6; g++) { - for(b = 0; b < 6; b++) { - color.red = sixd_to_16bit(r); - color.green = sixd_to_16bit(g); - color.blue = sixd_to_16bit(b); - if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &color, &dc.col[i])) { - die("Could not allocate color %d\n", i); - } - i++; - } - } + /* load colours [16-231] ; same colours as xterm */ + for(i = 16; i < 6*6*6+16; i++) { + color.red = sixd_to_16bit( ((i-16)/36)%6 ); + color.green = sixd_to_16bit( ((i-16)/6) %6 ); + color.blue = sixd_to_16bit( ((i-16)/1) %6 ); + if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &color, &dc.col[i])) + die("Could not allocate color %d\n", i); } - - for(r = 0; r < 24; r++, i++) { - color.red = color.green = color.blue = 0x0808 + 0x0a0a * r; - if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &color, - &dc.col[i])) { + + /* load colours [232-255] ; grayscale */ + for(; i < 256; i++) { + color.red = color.green = color.blue = 0x0808 + 0x0a0a * (i-(6*6*6+16)); + if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &color, &dc.col[i])) die("Could not allocate color %d\n", i); - } } loaded = true; } @@ -3149,22 +3142,13 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { } if(base.mode & ATTR_BOLD) { - if(BETWEEN(base.fg, 0, 7)) { - /* basic system colors */ - fg = &dc.col[base.fg + 8]; - } else if(BETWEEN(base.fg, 16, 195)) { - /* 256 colors */ - fg = &dc.col[base.fg + 36]; - } else if(BETWEEN(base.fg, 232, 251)) { - /* greyscale */ - fg = &dc.col[base.fg + 4]; - } /* - * Those ranges will not be brightened: - * 8 - 15 – bright system colors - * 196 - 231 – highest 256 color cube - * 252 - 255 – brightest colors in greyscale + * change basic system colours [0-7] + * to bright system colours [8-15] */ + if(BETWEEN(base.fg, 0, 7)) + fg = &dc.col[base.fg + 8]; + font = &dc.bfont; frcflags = FRC_BOLD; } -- 2.20.1 From f4ebb3180f9f03bc35034348a5aff8745eac9ebf Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Sat, 24 May 2014 13:48:44 +0200 Subject: [PATCH 10/16] Fixing trailing whitespaces. --- st.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/st.c b/st.c index a6b4ada..6424b54 100644 --- a/st.c +++ b/st.c @@ -2742,7 +2742,7 @@ xloadcols(void) { if(!XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &color, &dc.col[i])) die("Could not allocate color %d\n", i); } - + /* load colours [232-255] ; grayscale */ for(; i < 256; i++) { color.red = color.green = color.blue = 0x0808 + 0x0a0a * (i-(6*6*6+16)); @@ -3143,12 +3143,12 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { if(base.mode & ATTR_BOLD) { /* - * change basic system colours [0-7] + * change basic system colours [0-7] * to bright system colours [8-15] */ if(BETWEEN(base.fg, 0, 7)) fg = &dc.col[base.fg + 8]; - + font = &dc.bfont; frcflags = FRC_BOLD; } -- 2.20.1 From 488977c8efd0b3ad5bcc7a76f35e737f56381f45 Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Sat, 24 May 2014 13:52:24 +0200 Subject: [PATCH 11/16] Brightening is again on the TODO list. --- TODO | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO b/TODO index 3866f64..00cfdac 100644 --- a/TODO +++ b/TODO @@ -12,6 +12,7 @@ drawing ------- * add diacritics support to xdraws() * make the font cache simpler +* add better support for brightening of the upper colors bugs ---- -- 2.20.1 From 80d80512690c0ecb2627b31e1e0296256b27c896 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Sat, 24 May 2014 21:07:53 +0200 Subject: [PATCH 12/16] Add FRIGN to License, remove trailing whitespace Signed-off-by: Christoph Lohmann <20h@r-36.net> --- LICENSE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 910bec9..64dc414 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT/X Consortium License -© 2009-2012 Aurélien APTEL +© 2009-2012 Aurélien APTEL © 2009 Anselm R Garbe © 2012 Roberto E. Vargas Caballero © 2012 Christoph Lohmann <20h at r-36 dot net> @@ -10,6 +10,7 @@ MIT/X Consortium License © 2013 Eric Pruitt © 2013 Michael Forney © 2013 Markus Teich +© 2014 Laslo Hunhold Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), -- 2.20.1 From d03aa8d20bcc8a94a7737331a9ec0bf11df3e572 Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Sat, 24 May 2014 21:27:54 +0200 Subject: [PATCH 13/16] Fix some more LICENSE changes. --- LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 64dc414..0180b49 100644 --- a/LICENSE +++ b/LICENSE @@ -2,14 +2,14 @@ MIT/X Consortium License © 2009-2012 Aurélien APTEL © 2009 Anselm R Garbe -© 2012 Roberto E. Vargas Caballero -© 2012 Christoph Lohmann <20h at r-36 dot net> +© 2012-2014 Roberto E. Vargas Caballero +© 2012-2014 Christoph Lohmann <20h at r-36 dot net> © 2013 Eon S. Jeon © 2013 Alexander Sedov © 2013 Mark Edgar © 2013 Eric Pruitt © 2013 Michael Forney -© 2013 Markus Teich +© 2013-2014 Markus Teich © 2014 Laslo Hunhold Permission is hereby granted, free of charge, to any person obtaining a -- 2.20.1 From 2411308bd24c4db97a3bb06d38f183a679aec1ea Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 26 May 2014 09:23:56 +0400 Subject: [PATCH 14/16] Fixed copying empty lines inside selection. The code was assuming that empty lines have implicit wrap-around attribute. Signed-off-by: Roberto E. Vargas Caballero --- st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st.c b/st.c index 6424b54..506be0f 100644 --- a/st.c +++ b/st.c @@ -949,7 +949,7 @@ getsel(void) { * st. * FIXME: Fix the computer world. */ - if(y < sel.ne.y && x > 0 && !((gp-1)->mode & ATTR_WRAP)) + if(y < sel.ne.y && !(x > 0 && (gp-1)->mode & ATTR_WRAP)) *ptr++ = '\n'; /* -- 2.20.1 From ede83bd08b922f2f53264876f6500b564d3c5ef0 Mon Sep 17 00:00:00 2001 From: Christoph Lohmann <20h@r-36.net> Date: Sun, 1 Jun 2014 15:54:28 +0200 Subject: [PATCH 15/16] Fixing italic bold. Thanks Felipe Spychalski for the patch! --- st.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/st.c b/st.c index 506be0f..f48dab4 100644 --- a/st.c +++ b/st.c @@ -3149,8 +3149,13 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { if(BETWEEN(base.fg, 0, 7)) fg = &dc.col[base.fg + 8]; - font = &dc.bfont; - frcflags = FRC_BOLD; + if(base.mode & ATTR_ITALIC) { + font = &dc.ibfont; + frcflags = FRC_ITALICBOLD; + } else { + font = &dc.bfont; + frcflags = FRC_BOLD; + } } if(IS_SET(MODE_REVERSE)) { -- 2.20.1 From ba36d1394b3add5b9d4c174f1443cc312bcc7e09 Mon Sep 17 00:00:00 2001 From: Balazs Kezes Date: Sat, 31 May 2014 22:24:58 +0100 Subject: [PATCH 16/16] Don't report release events for mouse wheel Signed-off-by: Christoph Lohmann <20h@r-36.net> --- st.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/st.c b/st.c index f48dab4..79a4e0a 100644 --- a/st.c +++ b/st.c @@ -829,6 +829,8 @@ mousereport(XEvent *e) { /* MODE_MOUSEX10: no button release reporting */ if(IS_SET(MODE_MOUSEX10)) return; + if (button == 64 || button == 65) + return; } } -- 2.20.1