From 7569056388417d887baf2e959e18a767bcfe84f1 Mon Sep 17 00:00:00 2001 From: lvimuser <109605931+lvimuser@users.noreply.github.com> Date: Thu, 1 Dec 2022 12:24:35 +0000 Subject: [PATCH] experimental: make view follow cursor --- lua/cmp/view/custom_entries_view.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/cmp/view/custom_entries_view.lua b/lua/cmp/view/custom_entries_view.lua index a5eca58b1..ebc69d896 100644 --- a/lua/cmp/view/custom_entries_view.lua +++ b/lua/cmp/view/custom_entries_view.lua @@ -154,9 +154,7 @@ custom_entries_view.open = function(self, offset, entries) height = math.min(height, #self.entries) local pos = api.get_screen_cursor() - local cursor_before_line = api.get_cursor_before_line() - local delta = vim.fn.strdisplaywidth(cursor_before_line:sub(self.offset)) - local row, col = pos[1], pos[2] - delta - 1 + local row, col = pos[1], pos[2] - 1 local border_info = window.get_border_info({ style = completion }) local border_offset_row = border_info.top + border_info.bottom