diff options
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index b15a64ba32..0851e6cc5f 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -3386,6 +3386,7 @@ static char_u *set_chars_option(char_u **varp) { &fill_fold, "fold" , 183 }, // ยท { &fill_diff, "diff" , '-' }, { &fill_msgsep, "msgsep", ' ' }, + { &fill_eob, "eob", '~' }, }; static struct charstab lcstab[] = { { &lcs_eol, "eol", NUL }, @@ -3437,16 +3438,20 @@ static char_u *set_chars_option(char_u **varp) && p[len] == ':' && p[len + 1] != NUL) { s = p + len + 1; - c1 = mb_ptr2char_adv((const char_u **)&s); - if (mb_char2cells(c1) > 1) { + + // TODO(bfredl): use schar_T representation and utfc_ptr2len + int c1len = utf_ptr2len(s); + c1 = mb_cptr2char_adv((const char_u **)&s); + if (mb_char2cells(c1) > 1 || (c1len == 1 && c1 > 127)) { continue; } if (tab[i].cp == &lcs_tab2) { if (*s == NUL) { continue; } - c2 = mb_ptr2char_adv((const char_u **)&s); - if (mb_char2cells(c2) > 1) { + int c2len = utf_ptr2len(s); + c2 = mb_cptr2char_adv((const char_u **)&s); + if (mb_char2cells(c2) > 1 || (c2len == 1 && c2 > 127)) { continue; } } @@ -4102,11 +4107,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, errmsg = e_winwidth; } } else if (pp == &p_mco) { - if (value > MAX_MCO) { - errmsg = e_invarg; - } else if (value < 0) { - errmsg = e_positive; - } + value = MAX_MCO; } else if (pp == &p_titlelen) { if (value < 0) { errmsg = e_positive; @@ -4268,8 +4269,6 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) { parse_cino(curbuf); } - } else if (pp == &p_mco) { - screenclear(); // will re-allocate the screen } else if (pp == &curbuf->b_p_iminsert) { showmode(); // Show/unshow value of 'keymap' in status lines. |