Skip to content

Commit 86cf4bc

Browse files
authored
Merge pull request #495 from boydaihungst/patch-1
Update: extra Editor to support nvim 0.12
2 parents 692887e + 19e029b commit 86cf4bc

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

lua/markview/extras/editor.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,11 @@ editor.open_editor = function ()
366366

367367
--- Attaches LSP client.
368368
vim.api.nvim_buf_call(editor.buffer, function ()
369-
vim.cmd("LspStart");
369+
if vim.version.range(">=0.12"):has(vim.version()) then
370+
vim.cmd("lsp enable");
371+
else
372+
vim.cmd("LspStart");
373+
end
370374
end);
371375

372376
---_
@@ -550,8 +554,13 @@ editor.update_editor = function ()
550554

551555
--- Attaches LSP client.
552556
vim.api.nvim_buf_call(editor.buffer, function ()
553-
vim.cmd("LspStop");
554-
vim.cmd("LspStart");
557+
if vim.version.range(">=0.12"):has(vim.version()) then
558+
vim.cmd("lsp disable");
559+
vim.cmd("lsp enable");
560+
else
561+
vim.cmd("LspStop");
562+
vim.cmd("LspStart");
563+
end
555564
end);
556565

557566
---_

0 commit comments

Comments
 (0)