aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-12-16 13:50:12 +0100
committerbfredl <bjorn.linse@gmail.com>2022-12-20 21:43:42 +0100
commitb42d8a43b9f1b3316e73108ebefc4850b1a2c65b (patch)
tree408d480448e23225291092952c789888e2b60f25 /src/nvim/charset.c
parentf04087d8ba0623d1946eefe0f71d5f3e92d58c14 (diff)
downloadrneovim-b42d8a43b9f1b3316e73108ebefc4850b1a2c65b.tar.gz
rneovim-b42d8a43b9f1b3316e73108ebefc4850b1a2c65b.tar.bz2
rneovim-b42d8a43b9f1b3316e73108ebefc4850b1a2c65b.zip
refactor(tui): use nvim_echo() for verbose terminfo
This is needed for #18375 for the obvious reasons. note: verbose_terminfo_event is only temporarily needed until the full TUI process refactor is merged.
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index a8abee42be..51eddd5850 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -418,6 +418,22 @@ char *transstr(const char *const s, bool untab)
return buf;
}
+size_t kv_transstr(StringBuilder *str, const char *const s, bool untab)
+ FUNC_ATTR_NONNULL_ARG(1)
+{
+ if (!s) {
+ return 0;
+ }
+
+ // Compute the length of the result, taking account of unprintable
+ // multi-byte characters.
+ const size_t len = transstr_len(s, untab);
+ kv_ensure_space(*str, len + 1);
+ transstr_buf(s, str->items + str->size, len + 1, untab);
+ str->size += len; // do not include NUL byte
+ return len;
+}
+
/// Convert the string "str[orglen]" to do ignore-case comparing.
/// Use the current locale.
///