diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-24 13:58:29 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-09-04 21:18:23 +0800 |
commit | ceb09701f29dcabcf219f458fffbb64f5adced9b (patch) | |
tree | 48e315d1729c55a6ded2ab0b823d32ae55d45882 /src/nvim/api/vim.c | |
parent | 04bd700ac3bc2bdea0e0d8747de95dab2034aa11 (diff) | |
download | rneovim-ceb09701f29dcabcf219f458fffbb64f5adced9b.tar.gz rneovim-ceb09701f29dcabcf219f458fffbb64f5adced9b.tar.bz2 rneovim-ceb09701f29dcabcf219f458fffbb64f5adced9b.zip |
feat(api): add "move" to nvim_input_mouse
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 83d6ba8dc7..95c9919522 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -336,9 +336,9 @@ Integer nvim_input(String keys) /// mouse input in a GUI. The deprecated pseudokey form /// ("<LeftMouse><col,row>") of |nvim_input()| has the same limitation. /// -/// @param button Mouse button: one of "left", "right", "middle", "wheel". +/// @param button Mouse button: one of "left", "right", "middle", "wheel", "move". /// @param action For ordinary buttons, one of "press", "drag", "release". -/// For the wheel, one of "up", "down", "left", "right". +/// For the wheel, one of "up", "down", "left", "right". Ignored for "move". /// @param modifier String of modifiers each represented by a single char. /// The same specifiers are used as for a key press, except /// that the "-" separator is optional, so "C-A-", "c-a" @@ -365,6 +365,8 @@ void nvim_input_mouse(String button, String action, String modifier, Integer gri code = KE_RIGHTMOUSE; } else if (strequal(button.data, "wheel")) { code = KE_MOUSEDOWN; + } else if (strequal(button.data, "move")) { + code = KE_MOUSEMOVE; } else { goto error; } @@ -381,7 +383,7 @@ void nvim_input_mouse(String button, String action, String modifier, Integer gri } else { goto error; } - } else { + } else if (code != KE_MOUSEMOVE) { if (strequal(action.data, "press")) { // pass } else if (strequal(action.data, "drag")) { |