Skip to content

Commit

Permalink
fix(tests): Move validator version check outside
Browse files Browse the repository at this point in the history
This fixes tests on versions <0.10
  • Loading branch information
kristijanhusak committed Jan 6, 2025
1 parent ad88620 commit 2e45a6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/orgmode/utils/validator.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
local M = {}

local has_v_0_11 = vim.fn.has('nvim-0.11') > 0

--- Use the faster validate version if available
-- Taken from: https://github.com/lukas-reineke/indent-blankline.nvim/pull/934/files#diff-09ebcaa8c75cd1e92d25640e377ab261cfecaf8351c9689173fd36c2d0c23d94R16
--- @param spec table<string,[any, vim.validate.Validator, boolean|string]>
function M.validate(spec)
if vim.fn.has('nvim-0.11') == 0 then
if not has_v_0_11 then
return vim.validate(spec)
end
for key, key_spec in pairs(spec) do
Expand Down

0 comments on commit 2e45a6a

Please sign in to comment.