diff options
author | Christian Clason <christian.clason@uni-due.de> | 2020-09-30 18:03:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 18:03:40 +0200 |
commit | e5d98d85693245fec811307e5a2ccfdea3a350cd (patch) | |
tree | 5912e07eb20ea08d505b43f763c687c75c7cad51 /runtime/lua/vim/lsp/util.lua | |
parent | 3c5141d2cf359d9ac70799bb987482d753263782 (diff) | |
download | rneovim-e5d98d85693245fec811307e5a2ccfdea3a350cd.tar.gz rneovim-e5d98d85693245fec811307e5a2ccfdea3a350cd.tar.bz2 rneovim-e5d98d85693245fec811307e5a2ccfdea3a350cd.zip |
LSP: Fix separator width on hover (fixes #13006, #12998) (#13007)
* fix insert_separator conditional
* only draw separator over wrapped width
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index d94a8bb774..53f88dea7d 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -800,13 +800,14 @@ function M.fancy_floating_markdown(contents, opts) local width, height = M._make_floating_popup_size(stripped, opts) -- Insert blank line separator after code block - local insert_separator = opts.separator or true + local insert_separator = opts.separator + if insert_separator == nil then insert_separator = true end if insert_separator then for i, h in ipairs(highlights) do h.start = h.start + i - 1 h.finish = h.finish + i - 1 if h.finish + 1 <= #stripped then - table.insert(stripped, h.finish + 1, string.rep("─", width)) + table.insert(stripped, h.finish + 1, string.rep("─", math.min(width, opts.wrap_at))) height = height + 1 end end |