aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-14 14:00:56 +0100
committerGitHub <noreply@github.com>2023-03-14 14:00:56 +0100
commitd1e0f7454b5fc61d26db5af5ce00c1894e7c49fc (patch)
treeef972775c047745b19db5c06e1e490090d3a26f0 /src/nvim/charset.c
parent4f7879dff0f0dc22ddf4cb2a2095b88605a3bab0 (diff)
parentd6ecead36406233cc56353dd05f3380f0497630f (diff)
downloadrneovim-d1e0f7454b5fc61d26db5af5ce00c1894e7c49fc.tar.gz
rneovim-d1e0f7454b5fc61d26db5af5ce00c1894e7c49fc.tar.bz2
rneovim-d1e0f7454b5fc61d26db5af5ce00c1894e7c49fc.zip
Merge pull request #22666 from bfredl/unscreen
refactor(screen): screen.c delenda est
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index b792ae5ece..a3aa6783ee 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -660,6 +660,17 @@ size_t transchar_hex(char *const buf, const int c)
return i;
}
+/// Mirror text "str" for right-left displaying.
+/// Only works for single-byte characters (e.g., numbers).
+void rl_mirror_ascii(char *str)
+{
+ for (char *p1 = str, *p2 = str + strlen(str) - 1; p1 < p2; p1++, p2--) {
+ char t = *p1;
+ *p1 = *p2;
+ *p2 = t;
+ }
+}
+
/// Convert the lower 4 bits of byte "c" to its hex character
///
/// Lower case letters are used to avoid the confusion of <F1> being 0xf1 or