if (typebuf_changed(tb_change_cnt))
return 0;
- return fix_input_buffer(buf, len, script_char >= 0);
+ return fix_input_buffer(buf, len);
}
/*
* 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;
* 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)
{
}
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)
if (n > 0)
{
/* Replace zero and CSI by a special key code. */
- n = fix_input_buffer(buf + len, n, FALSE);
+ n = fix_input_buffer(buf + len, n);
len += n;
waited = 0;
}
int vpeekc_any(void);
int char_avail(void);
void vungetc(int c);
-int fix_input_buffer(char_u *buf, int len, int script);
+int fix_input_buffer(char_u *buf, int len);
int input_available(void);
int do_map(int maptype, char_u *arg, int mode, int abbrev);
int get_map_mode(char_u **cmdp, int forceit);
func Test_equivalence_re1()
set re=1
call s:equivalence_test()
+ set re=0
endfunc
func Test_equivalence_re2()
set re=2
call s:equivalence_test()
+ set re=0
endfunc
func s:classes_test()
func Test_classes_re1()
set re=1
call s:classes_test()
+ set re=0
endfunc
func Test_classes_re2()
set re=2
call s:classes_test()
+ set re=0
+endfunc
+
+func Test_source_utf8()
+ " check that sourcing a script with 0x80 as second byte works
+ new
+ call setline(1, [':%s/àx/--à1234--/g', ':%s/Àx/--À1234--/g'])
+ write! Xscript
+ bwipe!
+ new
+ call setline(1, [' àx ', ' Àx '])
+ source! Xscript | echo
+ call assert_equal(' --à1234-- ', getline(1))
+ call assert_equal(' --À1234-- ', getline(2))
+ bwipe!
+ call delete('Xscript')
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2222,
/**/
2221,
/**/