From 2a7eb32871a131e24021dd1756865e475fe7e274 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Thu, 14 Nov 2024 08:00:56 -0800 Subject: [PATCH] fix(previewer): page up at top of buffer (closes #1525) --- lua/fzf-lua/previewer/builtin.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/fzf-lua/previewer/builtin.lua b/lua/fzf-lua/previewer/builtin.lua index e8644087..2ec9909c 100644 --- a/lua/fzf-lua/previewer/builtin.lua +++ b/lua/fzf-lua/previewer/builtin.lua @@ -368,7 +368,7 @@ function Previewer.base:scroll(direction) local pos = is_ctrl_b and vim.api.nvim_win_get_cursor(0) if is_ctrl_b and pos[1] == 1 then return end vim.cmd([[norm! ]] .. input) - if is_ctrl_b and pos[1] <= vim.api.nvim_win_get_cursor(0)[1] then + if is_ctrl_b and pos[1] <= vim.api.nvim_win_get_cursor(0)[1] + 1 then vim.api.nvim_win_set_cursor(0, { 1, pos[2] }) end utils.zz()