Skip to content

Commit

Permalink
refactor: minor fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tris203 committed Dec 5, 2024
1 parent 28bc1d7 commit 959a55d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"type": {
"checkTableShape": true
},
"diagnostics.globals": [
"describe",
"it",
"before_each",
"after_each"
]
"diagnostics.globals": [
"describe",
"it",
"before_each",
"after_each"
]
}
4 changes: 2 additions & 2 deletions lua/precognition/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function M.show()
local prev_line
local draw = display_marks
if config.debounceMs > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounceMs)
local debounced = require("precognition.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 @@ -502,7 +502,7 @@ local state = {
local prev_line
local draw = display_marks
if config.debounceMs > 0 then
local debounced = utils.debounce_trailing(display_marks, config.debounceMs)
local debounced = require("precognition.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: 2 additions & 0 deletions tests/precognition/e2e_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ describe("e2e tests", function()

precognition.on_cursor_moved()

---@diagnostic disable-next-line: undefined-field
assert.is_nil(precognition.extmark)

eq(
Expand All @@ -153,6 +154,7 @@ describe("e2e tests", function()
coroutine.resume(co)
end, 210))

---@diagnostic disable-next-line: undefined-field
assert.not_nil(precognition.extmark)

local extmarks = vim.api.nvim_buf_get_extmark_by_id(buffer, precognition.ns, precognition.extmark, {
Expand Down

0 comments on commit 959a55d

Please sign in to comment.