diff options
author | ZviRackover <zvirack@gmail.com> | 2018-09-02 01:36:18 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-09-09 10:45:50 +0300 |
commit | ac13e65ae0ce98516e816ba4fcf468d19e750c30 (patch) | |
tree | e039a2201ece3358068a659b4bb84b204afd866b /src/nvim/ex_getln.c | |
parent | cbdbc4f63d68a6b17b9eea5c67130e37d3d0f278 (diff) | |
download | rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.tar.gz rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.tar.bz2 rneovim-ac13e65ae0ce98516e816ba4fcf468d19e750c30.zip |
Remove has_mbytes local to lines changed in parent commit
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index bfca888dc5..15308692e1 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1762,14 +1762,10 @@ static int command_line_handle_key(CommandLineState *s) if (IS_SPECIAL(s->c) || mod_mask != 0) { put_on_cmdline(get_special_key_name(s->c, mod_mask), -1, true); } else { - if (has_mbyte) { - s->j = utf_char2bytes(s->c, IObuff); - IObuff[s->j] = NUL; // exclude composing chars - put_on_cmdline(IObuff, s->j, true); - } else { - IObuff[0] = s->c; - put_on_cmdline(IObuff, 1, true); - } + s->j = utf_char2bytes(s->c, IObuff); + IObuff[s->j] = NUL; // exclude composing chars + put_on_cmdline(IObuff, s->j, true); + } return command_line_changed(s); } @@ -2372,12 +2368,7 @@ redraw: if (IS_SPECIAL(c1)) { c1 = '?'; } - if (has_mbyte) { - len = utf_char2bytes(c1, (char_u *)line_ga.ga_data + line_ga.ga_len); - } else { - len = 1; - ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1; - } + len = utf_char2bytes(c1, (char_u *)line_ga.ga_data + line_ga.ga_len); if (c1 == '\n') msg_putchar('\n'); else if (c1 == TAB) { |