diff --git a/libs/draw.c b/libs/draw.c index 67d9e21..02c6b00 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -57,8 +57,9 @@ drawitem(struct item *item, int x, int y, int w) if (item->text[rd + alen + 2] == 'm') { /* character is 'm' which is the last character in the sequence */ buffer[wr] = '\0'; /* clear out character */ - rw = pango_item ? TEXTWM(buffer) : TEXTW(buffer) - lrpad; - drw_text(drw, x, y, rw + lp, bh, lp, buffer, 0, pango_item ? True : False); + apply_fribidi(buffer); + rw = TEXTW(buffer) - lrpad; + drw_text(drw, x, y, rw + lp, bh, lp, isrtl ? fribidi_text : buffer, 0, pango_item ? True : False); x += rw + lp; ib = 1; diff --git a/libs/img.c b/libs/img.c index aba3b07..5266e8d 100644 --- a/libs/img.c +++ b/libs/img.c @@ -1,15 +1,19 @@ void flipimage(void) { - if (!flip) return; - if (flip == 1) { /* horizontal */ - imlib_image_flip_horizontal(); - } else if (flip == 2) { - imlib_image_flip_vertical(); - } else if (flip == 3) { - imlib_image_flip_diagonal(); - } else { - flip = 1; + switch (flip) { + case 1: /* horizontal */ + imlib_image_flip_horizontal(); + break; + case 2: /* vertical */ + imlib_image_flip_vertical(); + break; + case 3: /* diagonal */ + imlib_image_flip_diagonal(); + break; + default: + flip = flip ? 1 : 0; + return; } } @@ -27,22 +31,15 @@ cleanupimage(void) imlib_free_image(); image = NULL; } - - return; } void drawimage(void) { - #if !USEIMAGE - return; - #endif - int width = 0, height = 0; char *limg = NULL; - if (!lines) return; - if (hideimage) return; + if (!lines || hideimage) return; if (sel && sel->image && strcmp(sel->image, limg ? limg : "")) { if (longestedge) diff --git a/options.h b/options.h index d065d00..92ba15d 100644 --- a/options.h +++ b/options.h @@ -137,7 +137,7 @@ static char col_sgrcolor14[] = "#00ffff"; /* SGR color #14 */ static char col_sgrcolor15[] = "#ffffff"; /* SGR color #15 */ /* Pango options */ -static int pango_item = 0; /* Enable support for pango markup for the items */ +static int pango_item = 1; /* Enable support for pango markup for the items */ static int pango_highlight = 1; /* Enable support for pango markup for the highlighting */ static int pango_prompt = 1; /* Enable support for pango markup for the prompt */ static int pango_input = 1; /* Enable support for pango markup for user input */ diff --git a/spmenu.c b/spmenu.c index 19e000b..ad8a5f7 100644 --- a/spmenu.c +++ b/spmenu.c @@ -30,7 +30,6 @@ #define USEXINERAMA 0 #endif - /* include right to left language library */ #if USERTL #include @@ -735,21 +734,22 @@ navigatehistfile(int dir) strncpy(def, text, sizeof(def)); } - switch(dir) { - case 1: - if (histpos < histsz - 1) { - p = history[++histpos]; - } else if (histpos == histsz - 1) { - p = def; - histpos++; - } - break; - case -1: - if (histpos > 0) { - p = history[--histpos]; - } - break; + switch (dir) { + case 1: + if (histpos < histsz - 1) { + p = history[++histpos]; + } else if (histpos == histsz - 1) { + p = def; + histpos++; + } + break; + case -1: + if (histpos > 0) { + p = history[--histpos]; + } + break; } + if (p == NULL) { return; }