diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-09 03:20:44 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-09 03:20:44 -0400 |
| commit | 8423a7ed07a2cb5f2ebe54dac638632a40632ac7 (patch) | |
| tree | d207d47d89a9d95b081fe1dead5b9638a392ad4b /builtins/text.c | |
| parent | 0570acfa153fe7297257c0d39e5e0c4df3f8040a (diff) | |
Print paths as the literals look
Diffstat (limited to 'builtins/text.c')
| -rw-r--r-- | builtins/text.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtins/text.c b/builtins/text.c index c9244fa4..d804745d 100644 --- a/builtins/text.c +++ b/builtins/text.c @@ -1841,6 +1841,11 @@ static inline Text_t _quoted(Text_t text, bool colorize, char quote_char) public Text_t Text$as_text(const void *text, bool colorize, const TypeInfo *info) { (void)info; + if (info->TextInfo.lang && streq(info->TextInfo.lang, "Path")) { + if (!text) return Text("Path"); + return Text$format("(%s%k%s)", colorize ? "\x1b[35m" : "", text, colorize ? "\x1b[m" : ""); + } + if (!text) return info && info->TextInfo.lang ? Text$from_str(info->TextInfo.lang) : Text("Text"); Text_t as_text = _quoted(*(Text_t*)text, colorize, info == &Pattern$info ? '/' : '"'); if (info && info->TextInfo.lang && info != &Text$info && info != &Pattern$info) |
