diff options
Diffstat (limited to 'src/nvim/state.c')
-rw-r--r-- | src/nvim/state.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/state.c b/src/nvim/state.c index 32e2a8d652..c4041dda07 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -138,14 +138,20 @@ void state_handle_k_event(void) /// Return true if in the current mode we need to use virtual. bool virtual_active(win_T *wp) { - unsigned cur_ve_flags = get_ve_flags(wp); - // 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 != kNone) { return virtual_op; } + + // In Terminal mode the cursor can be positioned anywhere by the application + if (State & MODE_TERMINAL) { + return true; + } + + unsigned cur_ve_flags = get_ve_flags(wp); + return cur_ve_flags == kOptVeFlagAll || ((cur_ve_flags & kOptVeFlagBlock) && VIsual_active && VIsual_mode == Ctrl_V) || ((cur_ve_flags & kOptVeFlagInsert) && (State & MODE_INSERT)); |