mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
globals: eliminate "enc_utf8" macro
"enc_utf8" macro evaluates to "true". Continue dead code removal, started in https://github.com/neovim/neovim/pull/13275.
This commit is contained in:
@@ -530,12 +530,8 @@ void ins_bytes_len(char_u *p, size_t len)
|
|||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
for (size_t i = 0; i < len; i += n) {
|
for (size_t i = 0; i < len; i += n) {
|
||||||
if (enc_utf8) {
|
// avoid reading past p[len]
|
||||||
// avoid reading past p[len]
|
n = (size_t)utfc_ptr2len_len(p + i, (int)(len - i));
|
||||||
n = (size_t)utfc_ptr2len_len(p + i, (int)(len - i));
|
|
||||||
} else {
|
|
||||||
n = (size_t)(*mb_ptr2len)(p + i);
|
|
||||||
}
|
|
||||||
ins_char_bytes(p + i, n);
|
ins_char_bytes(p + i, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -761,7 +757,7 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine)
|
|||||||
|
|
||||||
// If 'delcombine' is set and deleting (less than) one character, only
|
// If 'delcombine' is set and deleting (less than) one character, only
|
||||||
// delete the last combining character.
|
// delete the last combining character.
|
||||||
if (p_deco && use_delcombine && enc_utf8
|
if (p_deco && use_delcombine
|
||||||
&& utfc_ptr2len(oldp + col) >= count) {
|
&& utfc_ptr2len(oldp + col) >= count) {
|
||||||
int cc[MAX_MCO];
|
int cc[MAX_MCO];
|
||||||
int n;
|
int n;
|
||||||
|
@@ -1310,14 +1310,11 @@ retry:
|
|||||||
char_u *dest;
|
char_u *dest;
|
||||||
char_u *tail = NULL;
|
char_u *tail = NULL;
|
||||||
|
|
||||||
/*
|
// Convert Unicode or Latin1 to UTF-8.
|
||||||
* "enc_utf8" set: Convert Unicode or Latin1 to UTF-8.
|
// Go from end to start through the buffer, because the number
|
||||||
* "enc_utf8" not set: Convert Unicode to Latin1.
|
// of bytes may increase.
|
||||||
* Go from end to start through the buffer, because the number
|
// "dest" points to after where the UTF-8 bytes go, "p" points
|
||||||
* of bytes may increase.
|
// to after the next character to convert.
|
||||||
* "dest" points to after where the UTF-8 bytes go, "p" points
|
|
||||||
* to after the next character to convert.
|
|
||||||
*/
|
|
||||||
dest = ptr + real_size;
|
dest = ptr + real_size;
|
||||||
if (fio_flags == FIO_LATIN1 || fio_flags == FIO_UTF8) {
|
if (fio_flags == FIO_LATIN1 || fio_flags == FIO_UTF8) {
|
||||||
p = ptr + size;
|
p = ptr + size;
|
||||||
|
@@ -585,8 +585,8 @@ EXTERN int vr_lines_changed INIT(= 0); // #Lines changed by "gR" so far
|
|||||||
EXTERN int inhibit_delete_count INIT(= 0);
|
EXTERN int inhibit_delete_count INIT(= 0);
|
||||||
|
|
||||||
// These flags are set based upon 'fileencoding'.
|
// These flags are set based upon 'fileencoding'.
|
||||||
// Note that "enc_utf8" is also set for "unicode", because the characters are
|
// The characters are internally stored as UTF-8
|
||||||
// internally stored as UTF-8 (to avoid trouble with NUL bytes).
|
// to avoid trouble with NUL bytes.
|
||||||
# define DBCS_JPN 932 // japan
|
# define DBCS_JPN 932 // japan
|
||||||
# define DBCS_JPNU 9932 // euc-jp
|
# define DBCS_JPNU 9932 // euc-jp
|
||||||
# define DBCS_KOR 949 // korea
|
# define DBCS_KOR 949 // korea
|
||||||
@@ -598,11 +598,6 @@ EXTERN int inhibit_delete_count INIT(= 0);
|
|||||||
# define DBCS_2BYTE 1 // 2byte-
|
# define DBCS_2BYTE 1 // 2byte-
|
||||||
# define DBCS_DEBUG -1
|
# define DBCS_DEBUG -1
|
||||||
|
|
||||||
// mbyte flags that used to depend on 'encoding'. These are now deprecated, as
|
|
||||||
// 'encoding' is always "utf-8". Code that use them can be refactored to
|
|
||||||
// remove dead code.
|
|
||||||
#define enc_utf8 true
|
|
||||||
|
|
||||||
/// Encoding used when 'fencs' is set to "default"
|
/// Encoding used when 'fencs' is set to "default"
|
||||||
EXTERN char_u *fenc_default INIT(= NULL);
|
EXTERN char_u *fenc_default INIT(= NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user