summaryrefslogtreecommitdiff
path: root/lua/telescope/actions
diff options
context:
space:
mode:
authorelianiva <dicha.arkana03@gmail.com>2021-02-24 21:40:11 +0700
committerGitHub <noreply@github.com>2021-02-24 21:40:11 +0700
commit8b3d08d7a6e8eccc2997ccbf91a7e12d506196e5 (patch)
tree46c00cfe4d97351a7c0041e7b17f72fd45def20b /lua/telescope/actions
parentb5051eeb01bfbff2df2b46f59c13318987ed1e59 (diff)
fix: scroll misbehaving + fixed jump to middle (#547)
* fix: scroll misbehaving + fixed jump to middle * add test * fixx * fix nil
Diffstat (limited to 'lua/telescope/actions')
-rw-r--r--lua/telescope/actions/init.lua6
-rw-r--r--lua/telescope/actions/set.lua1
2 files changed, 6 insertions, 1 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua
index 19a6d04..bf6bd4f 100644
--- a/lua/telescope/actions/init.lua
+++ b/lua/telescope/actions/init.lua
@@ -80,7 +80,11 @@ end
function actions.move_to_middle(prompt_bufnr)
local current_picker = actions.get_current_picker(prompt_bufnr)
- current_picker:set_selection(p_scroller.middle(nil, current_picker.max_results, nil))
+ current_picker:set_selection(p_scroller.middle(
+ current_picker.sorting_strategy,
+ current_picker.max_results,
+ current_picker.manager:num_results()
+ ))
end
function actions.move_to_bottom(prompt_bufnr)
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua
index 4e92848..bd4f1b3 100644
--- a/lua/telescope/actions/set.lua
+++ b/lua/telescope/actions/set.lua
@@ -28,6 +28,7 @@ local set = setmetatable({}, {
set.shift_selection = function(prompt_bufnr, change)
local count = vim.v.count
count = count == 0 and 1 or count
+ count = a.nvim_get_mode().mode == "n" and count or 1
action_state.get_current_picker(prompt_bufnr):move_selection(change * count)
end