0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1898: command modifier parsing always uses global cmdmod

Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
This commit is contained in:
Bram Moolenaar
2020-10-24 20:49:43 +02:00
parent 5661ed6c83
commit e100440158
38 changed files with 284 additions and 271 deletions

View File

@@ -204,7 +204,7 @@ op_shift(oparg_T *oap, int curs_top, int amount)
msg_attr_keep((char *)IObuff, 0, TRUE);
}
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set "'[" and "']" marks.
curbuf->b_op_start = oap->start;
@@ -943,7 +943,7 @@ op_delete(oparg_T *oap)
msgmore(curbuf->b_ml.ml_line_count - old_lcount);
setmarks:
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
if (oap->block_mode)
{
@@ -1216,7 +1216,7 @@ op_replace(oparg_T *oap, int c)
check_cursor();
changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, 0L);
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set "'[" and "']" marks.
curbuf->b_op_start = oap->start;
@@ -1329,7 +1329,7 @@ op_tilde(oparg_T *oap)
// No change: need to remove the Visual selection
redraw_curbuf_later(INVERTED);
if (!cmdmod.lockmarks)
if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set '[ and '] marks.
curbuf->b_op_start = oap->start;
@@ -1942,7 +1942,7 @@ do_join(
#ifdef FEAT_PROP_POPUP
propcount += count_props((linenr_T) (curwin->w_cursor.lnum + t), t > 0);
#endif
if (t == 0 && setmark && !cmdmod.lockmarks)
if (t == 0 && setmark && (cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set the '[ mark.
curwin->w_buffer->b_op_start.lnum = curwin->w_cursor.lnum;
@@ -2088,7 +2088,7 @@ do_join(
ml_replace_len(curwin->w_cursor.lnum, newp, (colnr_T)newp_len, TRUE, FALSE);
if (setmark && !cmdmod.lockmarks)
if (setmark && (cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// Set the '] mark.
curwin->w_buffer->b_op_end.lnum = curwin->w_cursor.lnum;
@@ -2405,7 +2405,7 @@ op_addsub(
// Set '[ mark if something changed. Keep the last end
// position from do_addsub().
if (change_cnt > 0 && !cmdmod.lockmarks)
if (change_cnt > 0 && (cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
curbuf->b_op_start = startpos;
if (change_cnt > p_report)
@@ -2852,7 +2852,7 @@ do_addsub(
--curwin->w_cursor.col;
}
if (did_change && !cmdmod.lockmarks)
if (did_change && (cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
{
// set the '[ and '] marks
curbuf->b_op_start = startpos;
@@ -3301,7 +3301,7 @@ op_function(oparg_T *oap UNUSED)
(void)call_func_retnr(p_opfunc, 1, argv);
virtual_op = save_virtual_op;
if (cmdmod.lockmarks)
if (cmdmod.cmod_flags & CMOD_LOCKMARKS)
{
curbuf->b_op_start = orig_start;
curbuf->b_op_end = orig_end;