Skip to content

Commit

Permalink
fix: nvim-0.9.5 support by calling vim.fn.has instead of vim.version
Browse files Browse the repository at this point in the history
vim.version is 0.10+
  • Loading branch information
rktjmp committed Nov 25, 2024
1 parent 28c73bd commit c59f03d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fnl/playtime/highlight.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
;;
;; Version check for 0.9.5 https://github.com/rktjmp/playtime.nvim/issues/5
;; as passing unknown options to the function raises.
(let [create (if (vim.version.ge (vim.version) [0 10 0]) false)
;;
;; Also note: vim.version also limited to 0.10+.
(let [create (if (= 1 (vim.fn.has :nvim-0.10.0)) false)
opts {:name name :link link? :create create}]
(vim.api.nvim_get_hl ns-id opts)))

Expand Down
4 changes: 3 additions & 1 deletion lua/playtime/highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@



local create if vim.version.ge(vim.version(), {0, 10, 0}) then create = false else create = nil end


local create if (1 == vim.fn.has("nvim-0.10.0")) then create = false else create = nil end
local opts = {name = name, link = link_3f, create = create}
return vim.api.nvim_get_hl(ns_id, opts) end

Expand Down

0 comments on commit c59f03d

Please sign in to comment.