diff --git a/lua/precognition/init.lua b/lua/precognition/init.lua index 84bb6d3..f76da0b 100644 --- a/lua/precognition/init.lua +++ b/lua/precognition/init.lua @@ -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 @@ -74,7 +74,7 @@ local defaultHintConfig = { ---@type Precognition.Config local default = { - debounce = 0, + debounceMs = 0, startVisible = true, showBlankVirtLine = true, highlightColor = { link = "Comment" }, @@ -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 @@ -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 diff --git a/tests/precognition/e2e_spec.lua b/tests/precognition/e2e_spec.lua index 29fe04c..56f3eb3 100644 --- a/tests/precognition/e2e_spec.lua +++ b/tests/precognition/e2e_spec.lua @@ -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)