diff options
Diffstat (limited to 'term.c')
-rw-r--r-- | term.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -407,6 +407,7 @@ term_fontpop(struct termp *p) void term_word(struct termp *p, const char *word) { + const char nbrsp[2] = { ASCII_NBRSP, 0 }; const char *seq, *cp; char c; int sz, uc; @@ -438,7 +439,15 @@ term_word(struct termp *p, const char *word) word++; continue; } - ssz = strcspn(word, "\\"); + if (TERMP_NBRWORD & p->flags) { + if (' ' == *word) { + encode(p, nbrsp, 1); + word++; + continue; + } + ssz = strcspn(word, "\\ "); + } else + ssz = strcspn(word, "\\"); encode(p, word, ssz); word += (int)ssz; continue; @@ -513,6 +522,7 @@ term_word(struct termp *p, const char *word) break; } } + p->flags &= ~TERMP_NBRWORD; } static void |