diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-12-23 17:13:13 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-01-01 15:47:44 +0100 |
commit | 6db86cb2d3d4ca152f156dc07362f8796150fae0 (patch) | |
tree | f87a1c0a009f4b0d054e53954db41ddeb25b991f /src/nvim/normal.c | |
parent | d0668b36a3e2d0683059baead45bea27e2358e9c (diff) | |
download | rneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.tar.gz rneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.tar.bz2 rneovim-6db86cb2d3d4ca152f156dc07362f8796150fae0.zip |
ui: make 'mouse' handling in external UI more consistent
before the behaviour of 'mouse' was inconsistent in external UI,
as some remapping logic would check has_mouse() and others don't
(no difference in TUI or vim classic). With this change, the behaviour
is consistently up to the UI decide (see ui.txt edit)
Behaviour of tui.c is unaffected by this change.
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 4b81a22f55..3ecac615b3 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2375,10 +2375,10 @@ do_mouse ( * Also paste at the cursor if the current mode isn't in 'mouse' (only * happens for the GUI). */ - if ((State & INSERT) || !mouse_has(MOUSE_NORMAL)) { - if (regname == '.') + if ((State & INSERT)) { + if (regname == '.') { insert_reg(regname, true); - else { + } else { if (regname == 0 && eval_has_provider("clipboard")) { regname = '*'; } @@ -2558,8 +2558,9 @@ do_mouse ( * on a status line */ if (VIsual_active) jump_flags |= MOUSE_MAY_STOP_VIS; - } else if (mouse_has(MOUSE_VISUAL)) + } else { jump_flags |= MOUSE_MAY_VIS; + } } else if (which_button == MOUSE_RIGHT) { if (is_click && VIsual_active) { /* @@ -2575,8 +2576,7 @@ do_mouse ( } } jump_flags |= MOUSE_FOCUS; - if (mouse_has(MOUSE_VISUAL)) - jump_flags |= MOUSE_MAY_VIS; + jump_flags |= MOUSE_MAY_VIS; } } @@ -2790,8 +2790,7 @@ do_mouse ( /* Handle double clicks, unless on status line */ else if (in_status_line) { } else if (in_sep_line) { - } else if ((mod_mask & MOD_MASK_MULTI_CLICK) && (State & (NORMAL | INSERT)) - && mouse_has(MOUSE_VISUAL)) { + } else if ((mod_mask & MOD_MASK_MULTI_CLICK) && (State & (NORMAL | INSERT))) { if (is_click || !VIsual_active) { if (VIsual_active) { orig_cursor = VIsual; |