aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-14 11:49:46 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-14 13:37:43 +0100
commitd6ecead36406233cc56353dd05f3380f0497630f (patch)
tree6adad28d9a446e422f114d285107595c563760a8 /src/nvim/charset.c
parentef31444cccdd93f515a8b7a968268cb04e680370 (diff)
downloadrneovim-d6ecead36406233cc56353dd05f3380f0497630f.tar.gz
rneovim-d6ecead36406233cc56353dd05f3380f0497630f.tar.bz2
rneovim-d6ecead36406233cc56353dd05f3380f0497630f.zip
refactor(screen): screen.c delenda est
drawscreen.c vs screen.c makes absolutely no sense. The screen exists only to draw upon it, therefore helper functions are distributed randomly between screen.c and the file that does the redrawing. In addition screen.c does a lot of drawing on the screen. It made more sense for vim/vim as our grid.c is their screen.c Not sure if we want to dump all the code for option chars into optionstr.c, so keep these in a optionchar.c for now.
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