ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.01k stars 56 forks source link

feat (config): pass woff to `floating_window_off_x` function #266

Closed pysan3 closed 1 year ago

pysan3 commented 1 year ago

Hi, thanks for the plugin!

May I have the value of woff passed to floating_window_off_x function?

I want to position the floating window at an absolute position (such that it anchors to the colorcolumn), but since the code adds whatever value woff to the output value, it is really hard to accomplish.

With the woff value passed to the function, I will be able to do something like this to place the window at the exact position I want.

floating_window_off_x = function(info)
  local woff = info.woff
  local the_absolute_position_i_want = 100
  local cur_pos = vim.api.nvim_win_get_cursor(0)[2] + 1
  return the_absolute_position_i_want - woff - cur_pos
end

BTW, what does woff stand for? Width of function? Word offset?

Thanks in advance, pysan3

ray-x commented 1 year ago

Sorry, it is really confusing... Please rename woff to x_off Sometime I might use w/h for x/y axis.

pysan3 commented 1 year ago

Thanks for the reply.

Do you mean that I should change it to

offx({ x_off = woff })

in the PR.

Or that I should change all occurrences of woff to x_off so that it'll be

offx({ x_off = x_off })?

pysan3 commented 1 year ago

Changed keyword to x_off ~