From 45b96b212c3229bdfe173f3fa2e991687972ed63 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Fri, 3 Sep 2021 20:12:28 +0900 Subject: [PATCH] Fix format --- lua/cmp/core.lua | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index 7841bdd..7c19992 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -19,7 +19,7 @@ core.SOURCE_TIMEOUT = 500 ---Suspending state. 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, { on_win = function() @@ -57,20 +57,14 @@ core.ghost_text = function(e) end text = string.sub(str.oneline(text), diff + 1) if #text > 0 then - vim.api.nvim_buf_set_extmark( - ctx.bufnr, - core.GHOST_TEXT_NS, - ctx.cursor.row - 1, - ctx.cursor.col - 1, - { - virt_text = { { text, 'Comment' } }, - virt_text_pos = 'overlay', - virt_text_win_col = ctx.virtcol - 1, - hl_mode = 'combine', - priority = 0, - ephemeral = true, - } - ) + vim.api.nvim_buf_set_extmark(ctx.bufnr, core.GHOST_TEXT_NS, ctx.cursor.row - 1, ctx.cursor.col - 1, { + virt_text = { { text, 'Comment' } }, + virt_text_pos = 'overlay', + virt_text_win_col = ctx.virtcol - 1, + hl_mode = 'combine', + priority = 0, + ephemeral = true, + }) end end @@ -80,7 +74,6 @@ core.sources = {} ---@type cmp.Context core.context = context.new() - ---Register source ---@param s cmp.Source core.register_source = function(s)