Skip to content

Commit c9bc713

Browse files
committed
Merge branch 'main' of github.com:rachartier/tiny-inline-diagnostic.nvim
2 parents 8f0f2e7 + 32c7e2e commit c9bc713

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/tiny-inline-diagnostic.nvim.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*tiny-inline-diagnostic.nvim.txt*For Neovim >= 0.10.0Last change: 2024 December 04
1+
*tiny-inline-diagnostic.nvim.txt*For Neovim >= 0.10.0Last change: 2024 December 06
22

33
==============================================================================
44
Table of Contents *tiny-inline-diagnostic.nvim-table-of-contents*

lua/tiny-inline-diagnostic/extmarks.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,16 @@ end
150150
--- @param buf number
151151
--- @param linenr number
152152
local function count_inlay_hints_characters(buf, linenr)
153+
local line_char_count = vim.fn.strchars(vim.api.nvim_buf_get_lines(buf, linenr, linenr + 1, false)[1])
153154
local inlay_hints = vim.lsp.inlay_hint.get({
154155
bufnr = buf,
155156
range = {
156157
start = { line = linenr, character = 0 },
157-
["end"] = { line = linenr, character = -1 },
158+
["end"] = { line = linenr, character = line_char_count },
158159
},
159160
})
160161
local count = 0
162+
161163
for _, hint in ipairs(inlay_hints) do
162164
if type(hint.inlay_hint.label) == "string" then
163165
count = count + #hint.inlay_hint.label

0 commit comments

Comments
 (0)