aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-03-10 21:22:42 -0500
committerJames McCoy <jamessan@jamessan.com>2017-03-11 20:32:27 -0500
commiteaf1f9b9dc62b2201fa54374a88029de1b3f94fb (patch)
tree6492d34391179a42505d237cd375a67404c0ac29 /src/nvim/getchar.c
parent564e9dc17fd53ab6cb1bc63a55dba2df9538a31f (diff)
downloadrneovim-eaf1f9b9dc62b2201fa54374a88029de1b3f94fb.tar.gz
rneovim-eaf1f9b9dc62b2201fa54374a88029de1b3f94fb.tar.bz2
rneovim-eaf1f9b9dc62b2201fa54374a88029de1b3f94fb.zip
vim-patch:7.4.2222
Problem: Sourcing a script where a character has 0x80 as a second byte does not work. (Filipe L B Correia) Solution: Turn 0x80 into K_SPECIAL KS_SPECIAL KE_FILLER. (Christian Brabandt, closes vim/vim#728) Add a test case. https://github.com/vim/vim/commit/6bff02eb530aa29aafa2cb5627399837be7a5dd5
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index b7c6fd41f2..46c1e89c31 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2460,7 +2460,7 @@ inchar (
if (typebuf_changed(tb_change_cnt))
return 0;
- return fix_input_buffer(buf, len, script_char >= 0);
+ return fix_input_buffer(buf, len);
}
/*
@@ -2468,12 +2468,7 @@ inchar (
* buf[] must have room to triple the number of bytes!
* Returns the new length.
*/
-int
-fix_input_buffer (
- char_u *buf,
- int len,
- int script /* TRUE when reading from a script */
-)
+int fix_input_buffer(char_u *buf, int len)
{
if (!using_script()) {
// Should not escape K_SPECIAL/CSI reading input from the user because vim
@@ -2490,11 +2485,9 @@ fix_input_buffer (
// Replace NUL by K_SPECIAL KS_ZERO KE_FILLER
// Replace K_SPECIAL by K_SPECIAL KS_SPECIAL KE_FILLER
// Replace CSI by K_SPECIAL KS_EXTRA KE_CSI
- // Don't replace K_SPECIAL when reading a script file.
for (i = len; --i >= 0; ++p) {
if (p[0] == NUL
|| (p[0] == K_SPECIAL
- && !script
&& (i < 2 || p[1] != KS_EXTRA))) {
memmove(p + 3, p + 1, (size_t)i);
p[2] = (char_u)K_THIRD(p[0]);