Skip to content

Commit

Permalink
fix(input): error on history_prev when no history
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 28, 2022
1 parent 3f23266 commit fc790e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/dressing/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ end
local history = {}
M.history_prev = function()
if context.history_idx == nil then
if #history == 0 then
return
end
context.history_tip = vim.api.nvim_buf_get_lines(0, 0, 1, true)[1]
context.history_idx = #history
elseif context.history_idx == 1 then
Expand Down

0 comments on commit fc790e4

Please sign in to comment.