Problem: Buffer left 'nomodifiable' after :substitute. (Ingo Karkat)
Solution: Save the value of 'modifiable' earlier' (Christian Brabandt,
closes #4403)
* 3. substitute the string.
*/
#ifdef FEAT_EVAL
+ save_ma = curbuf->b_p_ma;
if (subflags.do_count)
{
// prevent accidentally changing the buffer by a function
// Save flags for recursion. They can change for e.g.
// :s/^/\=execute("s#^##gn")
subflags_save = subflags;
- save_ma = curbuf->b_p_ma;
#endif
// get length of substitution part
sublen = vim_regsub_multi(®match,
set titlestring&
endfunc
+func Test_sub_cmd_9()
+ new
+ let input = ['1 aaa', '2 aaa', '3 aaa']
+ call setline(1, input)
+ func Foo()
+ return submatch(0)
+ endfunc
+ %s/aaa/\=Foo()/gn
+ call assert_equal(input, getline(1, '$'))
+ call assert_equal(1, &modifiable)
+
+ delfunc Foo
+ bw!
+endfunc
+
func Test_nocatch_sub_failure_handling()
" normal error results in all replacements
- func! Foo()
+ func Foo()
foobar
endfunc
new
call assert_equal(1, error_caught)
call assert_equal(['1 aaa', '2 aaa', '3 aaa'], getline(1, 3))
+ delfunc Foo
bwipe!
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1360,
/**/
1359,
/**/