瀏覽代碼

fix(peek): make sure popup_options are positive (#2373)

Abouzar Parvan 3 年之前
父節點
當前提交
4affc21771
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lua/lvim/lsp/peek.lua

+ 2 - 1
lua/lvim/lsp/peek.lua

@@ -33,7 +33,8 @@ local function create_floating_file(location, opts)
     false
   )
   local width, height = vim.lsp.util._make_floating_popup_size(contents, opts)
-  opts = vim.lsp.util.make_floating_popup_options(width, height, opts)
+  local if_nil = vim.F.if_nil
+  opts = vim.lsp.util.make_floating_popup_options(if_nil(width, 30), if_nil(height, 10), opts)
   -- Don't make it minimal as it is meant to be fully featured
   opts["style"] = nil