diff --git a/docs/mintty.1 b/docs/mintty.1 index ef994971..c6772f75 100644 --- a/docs/mintty.1 +++ b/docs/mintty.1 @@ -1425,6 +1425,13 @@ The RowSpacing value is added to that. .br (Corresponds roughly to the xterm resource \fBscaleHeight\fP.) +.TP +\fBLigatures support\fP (LigaturesSupport=0) +By default, ligatures, as supported by the selected font, are rendered +if they are output to the terminal in one chunk. When this option is +set =1, mintty redisplays the left part of the line whenever a character +is output, so ligatures are also supported while being input. + .TP \fB\fP(ColSpacing=0) Additional column padding; ColSpacing=1 can avoid boldened glyphs being clipped. diff --git a/src/config.c b/src/config.c index 6715649c..922bfee3 100644 --- a/src/config.c +++ b/src/config.c @@ -176,6 +176,7 @@ const config default_cfg = { .col_spacing = 0, .row_spacing = 0, .padding = 1, + .ligatures_support = 0, .handle_dpichanged = true, .check_version_update = 900, .word_chars = "", @@ -403,6 +404,7 @@ options[] = { {"ColSpacing", OPT_INT, offcfg(col_spacing)}, {"RowSpacing", OPT_INT, offcfg(row_spacing)}, {"Padding", OPT_INT, offcfg(padding)}, + {"LigaturesSupport", OPT_INT, offcfg(ligatures_support)}, {"HandleDPI", OPT_BOOL, offcfg(handle_dpichanged)}, {"CheckVersionUpdate", OPT_INT, offcfg(check_version_update)}, {"WordChars", OPT_STRING, offcfg(word_chars)}, diff --git a/src/config.h b/src/config.h index 38761ea1..ab03ce3b 100644 --- a/src/config.h +++ b/src/config.h @@ -174,6 +174,7 @@ typedef struct { int geom_sync; int col_spacing, row_spacing; int padding; + int ligatures_support; int handle_dpichanged; int check_version_update; string word_chars; diff --git a/src/termout.c b/src/termout.c index bc290373..e1b1cc52 100644 --- a/src/termout.c +++ b/src/termout.c @@ -279,6 +279,8 @@ write_char(wchar c, int width) clear_cc(line, curs->x); line->chars[curs->x].chr = c; line->chars[curs->x].attr = curs->attr; + if (cfg.ligatures_support) + term_invalidate(0, curs->y, curs->x, curs->y); } if (curs->wrapnext && curs->autowrap && width > 0) {