Skip to content

Commit

Permalink
rename debounce -> debounceMs
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy authored and tris203 committed Jun 2, 2024
1 parent ac1213a commit d5a2179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lua/precognition/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local M = {}
---@field NextParagraph Precognition.HintOpts

---@class Precognition.Config
---@field debounce integer
---@field debounceMs integer
---@field startVisible boolean
---@field showBlankVirtLine boolean
---@field highlightColor vim.api.keyset.highlight
Expand Down Expand Up @@ -75,7 +75,7 @@ local defaultHintConfig = {

---@type Precognition.Config
local default = {
debounce = 0,
debounceMs = 0,
startVisible = true,
showBlankVirtLine = true,
highlightColor = { link = "Comment" },
Expand Down Expand Up @@ -340,8 +340,8 @@ function M.show()

local prev_line
local draw = display_marks
if config.debounce > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounce)
if config.debounceMs > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounceMs)
draw = function(...)
local line = vim.api.nvim_win_get_cursor(0)[1]
if line == prev_line then
Expand Down Expand Up @@ -433,8 +433,8 @@ local state = {
on_cursor_moved = function()
local prev_line
local draw = display_marks
if config.debounce > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounce)
if config.debounceMs > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounceMs)
draw = function(...)
local line = vim.api.nvim_win_get_cursor(0)[1]
if line == prev_line then
Expand Down
2 changes: 1 addition & 1 deletion tests/precognition/e2e_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe("e2e tests", function()

it("supports debounce", function()
precognition.setup({
debounce = 200,
debounceMs = 200,
})

local buffer = vim.api.nvim_create_buf(true, false)
Expand Down

0 comments on commit d5a2179

Please sign in to comment.