mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
remove !has_mbyte branches
Ref: https://github.com/neovim/neovim/pull/10171#discussion_r292437832
This commit is contained in:
@@ -503,7 +503,6 @@ void ins_bytes(char_u *p)
|
||||
/// Handles Replace mode and multi-byte characters.
|
||||
void ins_bytes_len(char_u *p, size_t len)
|
||||
{
|
||||
if (has_mbyte) {
|
||||
size_t n;
|
||||
for (size_t i = 0; i < len; i += n) {
|
||||
if (enc_utf8) {
|
||||
@@ -514,11 +513,6 @@ void ins_bytes_len(char_u *p, size_t len)
|
||||
}
|
||||
ins_char_bytes(p + i, n);
|
||||
}
|
||||
} else {
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
ins_char(p[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Insert or replace a single character at the cursor position.
|
||||
@@ -597,11 +591,7 @@ void ins_char_bytes(char_u *buf, size_t charlen)
|
||||
// first (it tells the byte length of the character).
|
||||
replace_push(NUL);
|
||||
for (size_t i = 0; i < oldlen; i++) {
|
||||
if (has_mbyte) {
|
||||
i += (size_t)replace_push_mb(oldp + col + i) - 1;
|
||||
} else {
|
||||
replace_push(oldp[col + i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,7 +678,6 @@ void ins_str(char_u *s)
|
||||
// return FAIL for failure, OK otherwise
|
||||
int del_char(bool fixpos)
|
||||
{
|
||||
if (has_mbyte) {
|
||||
// Make sure the cursor is at the start of a character.
|
||||
mb_adjust_cursor();
|
||||
if (*get_cursor_pos_ptr() == NUL) {
|
||||
@@ -696,8 +685,6 @@ int del_char(bool fixpos)
|
||||
}
|
||||
return del_chars(1L, fixpos);
|
||||
}
|
||||
return del_bytes(1, fixpos, true);
|
||||
}
|
||||
|
||||
/// Like del_bytes(), but delete characters instead of bytes.
|
||||
int del_chars(long count, int fixpos)
|
||||
@@ -983,11 +970,7 @@ int open_line(
|
||||
replace_push(NUL);
|
||||
p = saved_line + curwin->w_cursor.col;
|
||||
while (*p != NUL) {
|
||||
if (has_mbyte) {
|
||||
p += replace_push_mb(p);
|
||||
} else {
|
||||
replace_push(*p++);
|
||||
}
|
||||
}
|
||||
saved_line[curwin->w_cursor.col] = NUL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user