diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-05 18:07:15 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-25 18:57:35 -0300 |
commit | b16c5bf5e6e2b7fd5f592ccec4f17bbf937e6d9b (patch) | |
tree | 1320080d0b40e1a360fba45f63d8f2a23ee16ced /src/nvim/normal.c | |
parent | 8b6b06c2e08ae3bfd5aaa5b920a521a03b42a2b3 (diff) | |
download | rneovim-b16c5bf5e6e2b7fd5f592ccec4f17bbf937e6d9b.tar.gz rneovim-b16c5bf5e6e2b7fd5f592ccec4f17bbf937e6d9b.tar.bz2 rneovim-b16c5bf5e6e2b7fd5f592ccec4f17bbf937e6d9b.zip |
buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macro
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index a708aca136..e26f5a3d77 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1465,7 +1465,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) /* Force a redraw when operating on an empty Visual region, when * 'modifiable is off or creating a fold. */ - if (oap->is_VIsual && (oap->empty || !curbuf->b_p_ma + if (oap->is_VIsual && (oap->empty || !MODIFIABLE(curbuf) || oap->op_type == OP_FOLD )) redraw_curbuf_later(INVERTED); @@ -5513,9 +5513,9 @@ static void nv_Replace(cmdarg_T *cap) VIsual_mode = 'V'; nv_operator(cap); } else if (!checkclearopq(cap->oap)) { - if (!curbuf->b_p_ma) + if (!MODIFIABLE(curbuf)) { EMSG(_(e_modifiable)); - else { + } else { if (virtual_active()) coladvance(getviscol()); invoke_edit(cap, false, cap->arg ? 'V' : 'R', false); @@ -5533,9 +5533,9 @@ static void nv_vreplace(cmdarg_T *cap) cap->nchar = cap->extra_char; nv_replace(cap); /* Do same as "r" in Visual mode for now */ } else if (!checkclearopq(cap->oap)) { - if (!curbuf->b_p_ma) + if (!MODIFIABLE(curbuf)) { EMSG(_(e_modifiable)); - else { + } else { if (cap->extra_char == Ctrl_V) /* get another character */ cap->extra_char = get_literal(); stuffcharReadbuff(cap->extra_char); |