Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
879e29504d | |||
8baf9b5459 | |||
6ac331b588 | |||
e229988a98 | |||
11a8a6bea7 | |||
4ebda08d49 | |||
6853b785d9 |
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## [10.8.2](https://github.com/LazyVim/LazyVim/compare/v10.8.1...v10.8.2) (2023-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** fix inlay hints for older nightlies. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([8baf9b5](https://github.com/LazyVim/LazyVim/commit/8baf9b5459a903c783a1d34ad438e64036a8e15e))
|
||||
|
||||
## [10.8.1](https://github.com/LazyVim/LazyVim/compare/v10.8.0...v10.8.1) (2023-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** detect if using nvim-0.10 and use new inlay_hint.enable method ([#2007](https://github.com/LazyVim/LazyVim/issues/2007)) ([6853b78](https://github.com/LazyVim/LazyVim/commit/6853b785d9916be6ffe4965aefd8554ed276f802))
|
||||
* **lsp:** inlay hints on stable. See [#2007](https://github.com/LazyVim/LazyVim/issues/2007) ([e229988](https://github.com/LazyVim/LazyVim/commit/e229988a98a81b000fda3aadbb4fc404aeaa599e))
|
||||
* **ui:** signcolumn signs on nightly. Fixes [#2039](https://github.com/LazyVim/LazyVim/issues/2039) ([11a8a6b](https://github.com/LazyVim/LazyVim/commit/11a8a6bea7a26ca5257fa4cbef90e0abdb22c349))
|
||||
|
||||
## [10.8.0](https://github.com/LazyVim/LazyVim/compare/v10.7.1...v10.8.0) (2023-11-04)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 04
|
||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 November 30
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *LazyVim-table-of-contents*
|
||||
|
@ -3,7 +3,7 @@ local Util = require("lazyvim.util")
|
||||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "10.8.0" -- x-release-please-version
|
||||
M.version = "10.8.2" -- x-release-please-version
|
||||
|
||||
---@class LazyVimOptions
|
||||
local defaults = {
|
||||
|
@ -119,8 +119,8 @@ map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Lin
|
||||
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
if vim.lsp.inlay_hint then
|
||||
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
|
||||
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
|
||||
map( "n", "<leader>uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
||||
end
|
||||
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
||||
|
||||
|
@ -115,12 +115,10 @@ return {
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
|
||||
if opts.inlay_hints.enabled and inlay_hint then
|
||||
if opts.inlay_hints.enabled then
|
||||
Util.lsp.on_attach(function(client, buffer)
|
||||
if client.supports_method("textDocument/inlayHint") then
|
||||
inlay_hint(buffer, true)
|
||||
Util.toggle.inlay_hints(buffer, true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
@ -53,6 +53,20 @@ function M.diagnostics()
|
||||
end
|
||||
end
|
||||
|
||||
---@param buf? number
|
||||
---@param value? boolean
|
||||
function M.inlay_hints(buf, value)
|
||||
local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
if type(ih) == "function" then
|
||||
ih(buf, value)
|
||||
elseif type(ih) == "table" and ih.enable then
|
||||
if value == nil then
|
||||
value = not ih.is_enabled(buf)
|
||||
end
|
||||
ih.enable(buf, value)
|
||||
end
|
||||
end
|
||||
|
||||
setmetatable(M, {
|
||||
__call = function(m, ...)
|
||||
return m.option(...)
|
||||
|
@ -10,12 +10,19 @@ local M = {}
|
||||
function M.get_signs(buf, lnum)
|
||||
-- Get regular signs
|
||||
---@type Sign[]
|
||||
local signs = vim.tbl_map(function(sign)
|
||||
---@type Sign
|
||||
local ret = vim.fn.sign_getdefined(sign.name)[1]
|
||||
ret.priority = sign.priority
|
||||
return ret
|
||||
end, vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs)
|
||||
local signs = {}
|
||||
|
||||
if vim.fn.has("nvim-0.10") == 0 then
|
||||
-- Only needed for Neovim <0.10
|
||||
-- Newer versions include legacy signs in nvim_buf_get_extmarks
|
||||
for _, sign in ipairs(vim.fn.sign_getplaced(buf, { group = "*", lnum = lnum })[1].signs) do
|
||||
local ret = vim.fn.sign_getdefined(sign.name)[1] --[[@as Sign]]
|
||||
if ret then
|
||||
ret.priority = sign.priority
|
||||
signs[#signs + 1] = ret
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Get extmark signs
|
||||
local extmarks = vim.api.nvim_buf_get_extmarks(
|
||||
|
Reference in New Issue
Block a user