ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
1.98k stars 53 forks source link

max_width is not working #296

Closed ghost closed 8 months ago

ghost commented 8 months ago

Expected Behavior

Plugin's popup should not exceed 30 characters wide.

Actual Behavior

Plugins popup exceeds 30 characters wide.

Steps to Reproduce

  1. Install with packer using the following line use "ray-x/lsp_signature.nvim".

  2. Add these lines to ~/.config/nvim/init.lua.

    
    local cfg = {
    max_width = 30,
    debug = true
    }

require "lsp_signature".setup(cfg)

  1. Go to Typescript and create an instance of a class

Details

debug mode shows at the beginning it reads the configuration and sets max_width to 30, going below shows the value width to be 60, which i imagine is the computed value.

ray-x commented 8 months ago

It is kind of expected:

config.max_width = math.max(_LSP_SIG_CFG.max_width, 60)

I adjusted it to be 40

config.max_width = math.max(_LSP_SIG_CFG.max_width, 40)

and update the doc. TBH, I do not think it shows anything decent when the size is below 60.

ghost commented 8 months ago

you are right it doesn't look too good, but is good to know, really appreciate your response