This commit is contained in:
hrsh7th
2021-11-15 14:26:50 +09:00
parent 05f4f8581c
commit 2de40ccf49

View File

@@ -137,11 +137,11 @@ custom_entries_view.open = function(self, offset, entries)
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 - pos[1]) <= 8 and pos[1] - 8 > 0 then if (vim.o.lines - pos[1]) <= height and pos[1] - height > 0 then
height = math.min(height, pos[1] - 1)
pos[1] = pos[1] - height - 1 pos[1] = pos[1] - height - 1
else end
height = math.min(height, vim.o.lines - pos[1]) if (vim.o.columns - pos[2]) <= width and pos[2] - width > 0 then
pos[2] = vim.o.columns - width + 1
end end
if width < 1 or height < 1 then if width < 1 or height < 1 then