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 13, 2024
1 parent 93472d6 commit 878bdd6
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 @@ -22,7 +22,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 @@ -71,7 +71,7 @@ local defaultHintConfig = {

---@type Precognition.Config
local default = {
debounce = 0,
debounceMs = 0,
startVisible = true,
showBlankVirtLine = true,
highlightColor = { link = "Comment" },
Expand Down Expand Up @@ -373,8 +373,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 @@ -468,8 +468,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 878bdd6

Please sign in to comment.