mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
globals: virtual_op is TriState
This commit is contained in:
parent
faa9869a9e
commit
44cb491f6e
@ -7395,7 +7395,7 @@ static void ex_operators(exarg_T *eap)
|
||||
oa.end.lnum = eap->line2;
|
||||
oa.line_count = eap->line2 - eap->line1 + 1;
|
||||
oa.motion_type = kMTLineWise;
|
||||
virtual_op = false;
|
||||
virtual_op = kFalse;
|
||||
if (eap->cmdidx != CMD_yank) { // position cursor for undo
|
||||
setpcmark();
|
||||
curwin->w_cursor.lnum = eap->line1;
|
||||
@ -7426,7 +7426,7 @@ static void ex_operators(exarg_T *eap)
|
||||
op_shift(&oa, FALSE, eap->amount);
|
||||
break;
|
||||
}
|
||||
virtual_op = MAYBE;
|
||||
virtual_op = kNone;
|
||||
ex_may_print(eap);
|
||||
}
|
||||
|
||||
|
@ -952,9 +952,9 @@ EXTERN char psepcN INIT(= '/'); // abnormal path separator character
|
||||
EXTERN char pseps[2] INIT(= { '\\', 0 }); // normal path separator string
|
||||
#endif
|
||||
|
||||
/* Set to TRUE when an operator is being executed with virtual editing, MAYBE
|
||||
* when no operator is being executed, FALSE otherwise. */
|
||||
EXTERN int virtual_op INIT(= MAYBE);
|
||||
// Set to kTrue when an operator is being executed with virtual editing
|
||||
// kNone when no operator is being executed, kFalse otherwise.
|
||||
EXTERN TriState virtual_op INIT(= kNone);
|
||||
|
||||
/* Display tick, incremented for each call to update_screen() */
|
||||
EXTERN disptick_T display_tick INIT(= 0);
|
||||
|
@ -2015,7 +2015,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
|
||||
default:
|
||||
clearopbeep(oap);
|
||||
}
|
||||
virtual_op = MAYBE;
|
||||
virtual_op = kNone;
|
||||
if (!gui_yank) {
|
||||
/*
|
||||
* if 'sol' not set, go back to old column for some commands
|
||||
@ -2090,7 +2090,7 @@ static void op_colon(oparg_T *oap)
|
||||
*/
|
||||
static void op_function(oparg_T *oap)
|
||||
{
|
||||
int save_virtual_op = virtual_op;
|
||||
const TriState save_virtual_op = virtual_op;
|
||||
|
||||
if (*p_opfunc == NUL)
|
||||
EMSG(_("E774: 'operatorfunc' is empty"));
|
||||
@ -2113,7 +2113,7 @@ static void op_function(oparg_T *oap)
|
||||
|
||||
// Reset virtual_op so that 'virtualedit' can be changed in the
|
||||
// function.
|
||||
virtual_op = MAYBE;
|
||||
virtual_op = kNone;
|
||||
|
||||
(void)call_func_retnr(p_opfunc, 1, argv, false);
|
||||
|
||||
|
@ -5383,7 +5383,7 @@ void cursor_pos_info(dict_T *dict)
|
||||
case Ctrl_V:
|
||||
virtual_op = virtual_active();
|
||||
block_prep(&oparg, &bd, lnum, 0);
|
||||
virtual_op = MAYBE;
|
||||
virtual_op = kNone;
|
||||
s = bd.textstart;
|
||||
len = (long)bd.textlen;
|
||||
break;
|
||||
|
@ -73,13 +73,13 @@ getkey:
|
||||
}
|
||||
}
|
||||
|
||||
/// Return TRUE if in the current mode we need to use virtual.
|
||||
int virtual_active(void)
|
||||
/// Return true if in the current mode we need to use virtual.
|
||||
bool virtual_active(void)
|
||||
{
|
||||
// While an operator is being executed we return "virtual_op", because
|
||||
// VIsual_active has already been reset, thus we can't check for "block"
|
||||
// being used.
|
||||
if (virtual_op != MAYBE) {
|
||||
if (virtual_op != kNone) {
|
||||
return virtual_op;
|
||||
}
|
||||
return ve_flags == VE_ALL
|
||||
|
Loading…
Reference in New Issue
Block a user