1
0
Fork 0

nvim: rework lsp_sig_status()

This commit is contained in:
tastytea 2022-11-14 14:17:32 +01:00
parent 19e76a16d8
commit 48af73653f
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 14 additions and 1 deletions

View File

@ -140,11 +140,24 @@ function M.lsp_status()
end
function M.lsp_sig_status()
if not vim.lsp.buf.server_ready() then
return ""
end
local width = vim.o.columns / 3
if width < 40 then
return ""
end
if width > 50 then
width = width * 1.5
end
return require('lsp_signature').status_line(width).label
local label = require('lsp_signature').status_line().label
if label:len() > width then
label = label:sub(1, width) .. ''
end
return label
end
function M.not_firenvim()