Skip to content

Commit

Permalink
fix: cmp popupmenu position (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc authored Nov 11, 2022
1 parent e5092c2 commit 8db0420
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/noice/util/hacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local require = require("noice.util.lazy")
local Util = require("noice.util")
local Router = require("noice.message.router")
local Api = require("noice.api")
local Cmdline = require("noice.ui.cmdline")

-- HACK: a bunch of hacks to make Noice behave
local M = {}
Expand Down Expand Up @@ -215,7 +216,8 @@ function M.fix_cmp()
if api.is_cmdline_mode() then
local pos = Api.get_cmdline_position()
if pos then
return { pos.screenpos.row, pos.screenpos.col + vim.fn.getcmdpos() - 1 }
local col = vim.fn.getcmdpos() - Cmdline.last().offset
return { pos.screenpos.row, pos.screenpos.col + col }
end
end
return get_screen_cursor()
Expand Down

0 comments on commit 8db0420

Please sign in to comment.