summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-16 22:50:55 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-16 22:50:55 +0200
commit6bff02eb530aa29aafa2cb5627399837be7a5dd5 (patch)
treebbdc08501666f8c44b1bc16b8f4724360555b398 /src/getchar.c
parent91984b9034d3b698459622be277d963e0c6df60e (diff)
patch 7.4.2222v7.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 #728) Add a test case.
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 03c75869e1..1c170cc435 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3060,7 +3060,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);
}
/*
@@ -3069,10 +3069,7 @@ inchar(
* Returns the new length.
*/
int
-fix_input_buffer(
- char_u *buf,
- int len,
- int script) /* TRUE when reading from a script */
+fix_input_buffer(char_u *buf, int len)
{
int i;
char_u *p = buf;
@@ -3083,7 +3080,6 @@ 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)
{
@@ -3106,7 +3102,7 @@ fix_input_buffer(
}
else
#endif
- if (p[0] == NUL || (p[0] == K_SPECIAL && !script
+ if (p[0] == NUL || (p[0] == K_SPECIAL
#ifdef FEAT_AUTOCMD
/* timeout may generate K_CURSORHOLD */
&& (i < 2 || p[1] != KS_EXTRA || p[2] != (int)KE_CURSORHOLD)