Fix format
This commit is contained in:
@@ -19,7 +19,7 @@ core.SOURCE_TIMEOUT = 500
|
|||||||
---Suspending state.
|
---Suspending state.
|
||||||
core.suspending = false
|
core.suspending = false
|
||||||
|
|
||||||
core.GHOST_TEXT_NS = vim.api.nvim_create_namespace('cmp:GHOST_TEXT');
|
core.GHOST_TEXT_NS = vim.api.nvim_create_namespace('cmp:GHOST_TEXT')
|
||||||
|
|
||||||
vim.api.nvim_set_decoration_provider(core.GHOST_TEXT_NS, {
|
vim.api.nvim_set_decoration_provider(core.GHOST_TEXT_NS, {
|
||||||
on_win = function()
|
on_win = function()
|
||||||
@@ -57,20 +57,14 @@ core.ghost_text = function(e)
|
|||||||
end
|
end
|
||||||
text = string.sub(str.oneline(text), diff + 1)
|
text = string.sub(str.oneline(text), diff + 1)
|
||||||
if #text > 0 then
|
if #text > 0 then
|
||||||
vim.api.nvim_buf_set_extmark(
|
vim.api.nvim_buf_set_extmark(ctx.bufnr, core.GHOST_TEXT_NS, ctx.cursor.row - 1, ctx.cursor.col - 1, {
|
||||||
ctx.bufnr,
|
virt_text = { { text, 'Comment' } },
|
||||||
core.GHOST_TEXT_NS,
|
virt_text_pos = 'overlay',
|
||||||
ctx.cursor.row - 1,
|
virt_text_win_col = ctx.virtcol - 1,
|
||||||
ctx.cursor.col - 1,
|
hl_mode = 'combine',
|
||||||
{
|
priority = 0,
|
||||||
virt_text = { { text, 'Comment' } },
|
ephemeral = true,
|
||||||
virt_text_pos = 'overlay',
|
})
|
||||||
virt_text_win_col = ctx.virtcol - 1,
|
|
||||||
hl_mode = 'combine',
|
|
||||||
priority = 0,
|
|
||||||
ephemeral = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -80,7 +74,6 @@ core.sources = {}
|
|||||||
---@type cmp.Context
|
---@type cmp.Context
|
||||||
core.context = context.new()
|
core.context = context.new()
|
||||||
|
|
||||||
|
|
||||||
---Register source
|
---Register source
|
||||||
---@param s cmp.Source
|
---@param s cmp.Source
|
||||||
core.register_source = function(s)
|
core.register_source = function(s)
|
||||||
|
|||||||
Reference in New Issue
Block a user