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 Dec 5, 2024
1 parent 7d6bccc commit 28bc1d7
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 @@ -24,7 +24,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 @@ -74,7 +74,7 @@ local defaultHintConfig = {

---@type Precognition.Config
local default = {
debounce = 0,
debounceMs = 0,
startVisible = true,
showBlankVirtLine = true,
highlightColor = { link = "Comment" },
Expand Down Expand Up @@ -395,8 +395,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 @@ -501,8 +501,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 @@ -124,7 +124,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 28bc1d7

Please sign in to comment.