Mercurial > vim
comparison src/ex_cmds.c @ 16716:5a541d459ef7 v8.1.1360
patch 8.1.1360: buffer left 'nomodifiable' after :substitute
commit https://github.com/vim/vim/commit/80341bcd89764d96f87859a3aac8bc00aad1d762
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 20 20:34:51 2019 +0200
patch 8.1.1360: buffer left 'nomodifiable' after :substitute
Problem: Buffer left 'nomodifiable' after :substitute. (Ingo Karkat)
Solution: Save the value of 'modifiable' earlier' (Christian Brabandt,
closes #4403)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 May 2019 20:45:06 +0200 |
parents | ba592f30c082 |
children | b52ea9c5f1db |
comparison
equal
deleted
inserted
replaced
16715:2cb98b7ef466 | 16716:5a541d459ef7 |
---|---|
5555 | 5555 |
5556 /* | 5556 /* |
5557 * 3. substitute the string. | 5557 * 3. substitute the string. |
5558 */ | 5558 */ |
5559 #ifdef FEAT_EVAL | 5559 #ifdef FEAT_EVAL |
5560 save_ma = curbuf->b_p_ma; | |
5560 if (subflags.do_count) | 5561 if (subflags.do_count) |
5561 { | 5562 { |
5562 // prevent accidentally changing the buffer by a function | 5563 // prevent accidentally changing the buffer by a function |
5563 curbuf->b_p_ma = FALSE; | 5564 curbuf->b_p_ma = FALSE; |
5564 sandbox++; | 5565 sandbox++; |
5565 } | 5566 } |
5566 // Save flags for recursion. They can change for e.g. | 5567 // Save flags for recursion. They can change for e.g. |
5567 // :s/^/\=execute("s#^##gn") | 5568 // :s/^/\=execute("s#^##gn") |
5568 subflags_save = subflags; | 5569 subflags_save = subflags; |
5569 save_ma = curbuf->b_p_ma; | |
5570 #endif | 5570 #endif |
5571 // get length of substitution part | 5571 // get length of substitution part |
5572 sublen = vim_regsub_multi(®match, | 5572 sublen = vim_regsub_multi(®match, |
5573 sub_firstlnum - regmatch.startpos[0].lnum, | 5573 sub_firstlnum - regmatch.startpos[0].lnum, |
5574 sub, sub_firstline, FALSE, p_magic, TRUE); | 5574 sub, sub_firstline, FALSE, p_magic, TRUE); |