mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-15 10:23:45 +00:00
feat(actions): support scrolling and selecting with the mouse (#2687)
* feat(scrolling and mouse support): support scrolling and selecting with the mouse * fix ascending sorting_strategy mouse clicks --------- Co-authored-by: James Trew <j.trew10@gmail.com>
This commit is contained in:
co-authored by
James Trew
parent
b22e6f6896
commit
1bb28df3cf
@@ -133,6 +133,37 @@ local mappings = {}
|
||||
mappings.default_mappings = config.values.default_mappings
|
||||
or {
|
||||
i = {
|
||||
["<ScrollWheelDown>"] = {
|
||||
actions.mouse_scroll_up,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelUp>"] = {
|
||||
actions.mouse_scroll_down,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelLeft>"] = {
|
||||
actions.mouse_scroll_right,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelRight>"] = {
|
||||
actions.mouse_scroll_left,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<LeftMouse>"] = {
|
||||
actions.mouse_click,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<2-LeftMouse>"] = {
|
||||
actions.double_mouse_click,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
|
||||
["<C-n>"] = actions.move_selection_next,
|
||||
["<C-p>"] = actions.move_selection_previous,
|
||||
|
||||
@@ -169,8 +200,38 @@ mappings.default_mappings = config.values.default_mappings
|
||||
-- disable c-j because we dont want to allow new lines #2123
|
||||
["<C-j>"] = actions.nop,
|
||||
},
|
||||
|
||||
n = {
|
||||
["<ScrollWheelDown>"] = {
|
||||
actions.mouse_scroll_up,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelUp>"] = {
|
||||
actions.mouse_scroll_down,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelLeft>"] = {
|
||||
actions.mouse_scroll_right,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<ScrollWheelRight>"] = {
|
||||
actions.mouse_scroll_left,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<LeftMouse>"] = {
|
||||
actions.mouse_click,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
["<2-LeftMouse>"] = {
|
||||
actions.double_mouse_click,
|
||||
type = "action",
|
||||
opts = { expr = true },
|
||||
},
|
||||
|
||||
["<esc>"] = actions.close,
|
||||
["<CR>"] = actions.select_default,
|
||||
["<C-x>"] = actions.select_horizontal,
|
||||
|
||||
Reference in New Issue
Block a user