mirror of
https://github.com/hexedtech/codemp-nvim.git
synced 2024-11-22 15:34:53 +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
|
||||||
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 {
|
return {
|
||||||
multiline_highlight = multiline_highlight,
|
multiline_highlight = multiline_highlight,
|
||||||
|
@ -179,6 +186,7 @@ return {
|
||||||
position = cursor_position,
|
position = cursor_position,
|
||||||
},
|
},
|
||||||
buffer = {
|
buffer = {
|
||||||
|
len = buffer_len,
|
||||||
get_content = buffer_get_content,
|
get_content = buffer_get_content,
|
||||||
set_content = buffer_set_content,
|
set_content = buffer_set_content,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue