Skip to content

Commit

Permalink
Fix checks for Neovim 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ron.record committed Jun 12, 2024
1 parent 3dd58e5 commit fc11f84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/config/lsp/servers/tsserver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local handlers = {
{ virtual_text = false }
),
["textDocument/definition"] = function(err, result, method, ...)
if vim.fn.has("nvim-0.10") then
if vim.fn.has("nvim-0.10") == 1 then
if vim.islist(result) and #result > 1 then
local filtered_result = filter(result, filterReactDTS)
return vim.lsp.handlers["textDocument/definition"](err, filtered_result, method, ...)
Expand Down
2 changes: 1 addition & 1 deletion lua/ecovim/config/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ local signature = {}
local lspsaga = {}
local snippet = {}
local session = {}
if vim.fn.has("nvim-0.10") then
if vim.fn.has('nvim-0.10') == 1 then
session = {
"Shatur/neovim-session-manager",
lazy = false,
Expand Down
4 changes: 2 additions & 2 deletions lua/ecovim/plugins/typescript-tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local handlers = {
),
["textDocument/definition"] = function(err, result, method, ...)
P(result)
if vim.fn.has("nvim-0.10") then
if vim.fn.has("nvim-0.10") == 1 then
if vim.islist(result) and #result > 1 then
local filtered_result = filter(result, filterReactDTS)
return baseDefinitionHandler(err, filtered_result, method, ...)
Expand All @@ -33,7 +33,7 @@ local handlers = {

require("typescript-tools").setup({
on_attach = function(client, bufnr)
if vim.fn.has("nvim-0.10") then
if vim.fn.has("nvim-0.10") == 1 then
-- Enable inlay hints
vim.lsp.inlay_hint(bufnr, true)
end
Expand Down

0 comments on commit fc11f84

Please sign in to comment.