mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-21 23:14:54 +01:00
feat: buffer len util
This commit is contained in:
parent
b141ca5a2a
commit
087df96566
1 changed files with 8 additions and 0 deletions
|
@ -172,6 +172,13 @@ local function multiline_highlight(buf, ns, group, start, fini)
|
|||
end
|
||||
end
|
||||
|
||||
local function buffer_len(buf)
|
||||
local count = 0
|
||||
vim.api.nvim_buf_call(buf, function()
|
||||
count = vim.fn.wordcount().chars
|
||||
end)
|
||||
return count
|
||||
end
|
||||
|
||||
return {
|
||||
multiline_highlight = multiline_highlight,
|
||||
|
@ -179,6 +186,7 @@ return {
|
|||
position = cursor_position,
|
||||
},
|
||||
buffer = {
|
||||
len = buffer_len,
|
||||
get_content = buffer_get_content,
|
||||
set_content = buffer_set_content,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue