aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-11-26 21:53:07 +0100
committerbfredl <bjorn.linse@gmail.com>2023-11-26 21:53:07 +0100
commita917da4ca55be8726f26a8305c53bdd5b2c7eea4 (patch)
treebd523e5e08dbb07bab2d5abcd2bfa499347fea64 /src/nvim/charset.c
parent27fc11c0486354ce23ceb57649f22aedbfe2d48b (diff)
downloadrneovim-a917da4ca55be8726f26a8305c53bdd5b2c7eea4.tar.gz
rneovim-a917da4ca55be8726f26a8305c53bdd5b2c7eea4.tar.bz2
rneovim-a917da4ca55be8726f26a8305c53bdd5b2c7eea4.zip
refactor(encoding): remove redundant vim_isprintc_strict
This function is identical to vim_isprintc when encoding=utf-8 is used As this is the only internal encoding nvim supports, it is now redundant ref #2905
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index d3312516c6..64b2044dc8 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -534,7 +534,7 @@ char *transchar_buf(const buf_T *buf, int c)
}
if ((!chartab_initialized && (c >= ' ' && c <= '~'))
- || ((c <= 0xFF) && vim_isprintc_strict(c))) {
+ || ((c <= 0xFF) && vim_isprintc(c))) {
// printable character
transchar_charbuf[i] = (uint8_t)c;
transchar_charbuf[i + 1] = NUL;
@@ -870,7 +870,6 @@ bool vim_isfilec_or_wc(int c)
}
/// Check that "c" is a printable character.
-/// Assume characters above 0x100 are printable for double-byte encodings.
///
/// @param c character to check
bool vim_isprintc(int c)
@@ -882,21 +881,6 @@ bool vim_isprintc(int c)
return c > 0 && (g_chartab[c] & CT_PRINT_CHAR);
}
-/// Strict version of vim_isprintc(c), don't return true if "c" is the head
-/// byte of a double-byte character.
-///
-/// @param c character to check
-///
-/// @return true if "c" is a printable character.
-bool vim_isprintc_strict(int c)
- FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
-{
- if (c >= 0x100) {
- return utf_printable(c);
- }
- return c > 0 && (g_chartab[c] & CT_PRINT_CHAR);
-}
-
/// skipwhite: skip over ' ' and '\t'.
///
/// @param[in] p String to skip in.