Fix #320
This commit is contained in:
@@ -128,15 +128,15 @@ custom_entries_view.open = function(self, offset, entries)
|
|||||||
width = width + self.column_width.menu + 1
|
width = width + self.column_width.menu + 1
|
||||||
|
|
||||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||||
local row = vim.fn.screenpos('.', cursor[1], cursor[2] + 1).row
|
local pos = vim.fn.screenpos('.', cursor[1], cursor[2] + 1)
|
||||||
local height = vim.api.nvim_get_option('pumheight')
|
local height = vim.api.nvim_get_option('pumheight')
|
||||||
height = height == 0 and #self.entries or height
|
height = height == 0 and #self.entries or height
|
||||||
height = math.min(height, #self.entries)
|
height = math.min(height, #self.entries)
|
||||||
if (vim.o.lines - row) <= 8 and row - 8 > 0 then
|
if (vim.o.lines - pos.row) <= 8 and pos.row - 8 > 0 then
|
||||||
height = math.min(height, row - 1)
|
height = math.min(height, pos.row - 1)
|
||||||
row = row - height - 1
|
pos.row = pos.row - height - 1
|
||||||
else
|
else
|
||||||
height = math.min(height, vim.o.lines - row)
|
height = math.min(height, vim.o.lines - pos.row)
|
||||||
end
|
end
|
||||||
|
|
||||||
if width < 1 or height < 1 then
|
if width < 1 or height < 1 then
|
||||||
@@ -148,8 +148,8 @@ custom_entries_view.open = function(self, offset, entries)
|
|||||||
self.entries_win:open({
|
self.entries_win:open({
|
||||||
relative = 'editor',
|
relative = 'editor',
|
||||||
style = 'minimal',
|
style = 'minimal',
|
||||||
row = row,
|
row = pos.row,
|
||||||
col = vim.fn.screencol() - 1 - delta - 1,
|
col = pos.col - 1 - delta - 1,
|
||||||
width = width,
|
width = width,
|
||||||
height = height,
|
height = height,
|
||||||
zindex = 1001,
|
zindex = 1001,
|
||||||
|
|||||||
Reference in New Issue
Block a user