JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Changing the license to MIT/X.
[st.git] / st.c
diff --git a/st.c b/st.c
index d7a0fed..f063029 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2398,9 +2398,6 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
                 *temp, revfg, revbg;
        XRenderColor colfg, colbg;
 
-       if(base.mode & ATTR_REVERSE)
-               temp = fg, fg = bg, bg = temp;
-
        if(base.mode & ATTR_BOLD) {
                if(BETWEEN(base.fg, 0, 7)) {
                        /* basic system colors */
@@ -2423,7 +2420,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
 
        if(base.mode & ATTR_ITALIC)
                font = &dc.ifont;
-       if(base.mode & (ATTR_ITALIC|ATTR_BOLD))
+       if((base.mode & ATTR_ITALIC) && (base.mode & ATTR_BOLD))
                font = &dc.ibfont;
 
        if(IS_SET(MODE_REVERSE)) {
@@ -2450,6 +2447,9 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
                }
        }
 
+       if(base.mode & ATTR_REVERSE)
+               temp = fg, fg = bg, bg = temp;
+
        XftTextExtentsUtf8(xw.dpy, font->xft_set, (FcChar8 *)s, bytelen,
                        &extents);
        width = extents.xOff;
@@ -2694,6 +2694,9 @@ kpress(XEvent *ev) {
                                selpaste();
                        break;
                case XK_Return:
+                       if(meta)
+                               ttywrite("\033", 1);
+
                        if(IS_SET(MODE_CRLF)) {
                                ttywrite("\r\n", 2);
                        } else {
@@ -2742,8 +2745,6 @@ cresize(int width, int height)
 
        col = (xw.w - 2*borderpx) / xw.cw;
        row = (xw.h - 2*borderpx) / xw.ch;
-       if(col == term.col && row == term.row)
-               return;
 
        tresize(col, row);
        xresize(col, row);