vim-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 vim/vim#4403)
80341bcd89
This commit is contained in:
Jan Edmund Lazo
2019-05-20 21:56:56 -04:00
parent 7c979f972e
commit 7187020783
2 changed files with 18 additions and 1 deletions

View File

@@ -3817,6 +3817,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
// 3. Substitute the string. During 'inccommand' preview only do this if
// there is a replace pattern.
if (!preview || has_second_delim) {
save_ma = curbuf->b_p_ma;
if (subflags.do_count) {
// prevent accidentally changing the buffer by a function
curbuf->b_p_ma = false;