Browse Source

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

Abouzar Parvan 3 years ago
parent
commit
4affc21771
1 changed files with 2 additions and 1 deletions
  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