Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lua/fff/picker_ui/search_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,18 @@ function M.cycle_forward_query()
if not P.state.active then return end

if S.history_offset == nil then
S.history_offset = 0
elseif S.history_offset > 0 then
S.history_offset = S.history_offset - 1
else
-- At top of stack (fresh open or resume with pre-filled input).
-- Clear input to return to a clean slate.
S.history_offset = nil
vim.api.nvim_buf_set_lines(S.input_buf, 0, -1, false, { S.config.prompt })
return
elseif S.history_offset == 0 then
-- At the most recent history entry, go back to present
S.history_offset = nil
vim.api.nvim_buf_set_lines(S.input_buf, 0, -1, false, { S.config.prompt })
return
else
S.history_offset = S.history_offset - 1
end

local fuzzy = require('fff.core').ensure_initialized()
Expand Down
Loading