aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-18 12:54:58 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-01 15:28:49 -0400
commit44cb491f6e2dd0b1aafa9ab83fe5f13cfbb716df (patch)
tree587fe949b27f8e3d10fd78021e62779bf4f13252
parentfaa9869a9e7cc51a7dd88646f65a42b7972fa633 (diff)
downloadrneovim-44cb491f6e2dd0b1aafa9ab83fe5f13cfbb716df.tar.gz
rneovim-44cb491f6e2dd0b1aafa9ab83fe5f13cfbb716df.tar.bz2
rneovim-44cb491f6e2dd0b1aafa9ab83fe5f13cfbb716df.zip
globals: virtual_op is TriState
-rw-r--r--src/nvim/ex_docmd.c4
-rw-r--r--src/nvim/globals.h6
-rw-r--r--src/nvim/normal.c6
-rw-r--r--src/nvim/ops.c2
-rw-r--r--src/nvim/state.c6
5 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 97369c50d9..0ab0178d24 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -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);
}
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 9f84482ac4..3efc0838aa 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -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);
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 570368991a..a695620801 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -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);
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 67171cb27e..ba4f3cb431 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -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;
diff --git a/src/nvim/state.c b/src/nvim/state.c
index a4b394c9e4..5921bd45bf 100644
--- a/src/nvim/state.c
+++ b/src/nvim/state.c
@@ -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