-
-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
layout_strategy=vertical & layout_config.anchor='S' leaves one line #2851
layout_strategy=vertical & layout_config.anchor='S' leaves one line #2851
Comments
It looks to be by design (with tests)
That |
Thanks @jamestrew , would it make sense to create a config like
I can then pass 1 to negate the -1. What do you think? |
I'm thinking maybe something more like if anchor:find "W" then
pos[1] = math.ceil((p_width - max_columns) / 2) + anchor_padding
elseif anchor:find "E" then
pos[1] = math.ceil((max_columns - p_width) / 2) - anchor_padding
end
if anchor:find "N" then
pos[2] = math.ceil((p_height - max_lines) / 2) + anchor_padding
elseif anchor:find "S" then
pos[2] = math.ceil((max_lines - p_height) / 2) - anchor_padding
end |
I am interested in contributing this as my first pr/contribution, looks straightforward to me. Is there anyone working at it at the moment? |
I am not working on this @Weyaaron . Looking forward to this getting fixed tho :) |
I started work on it, I got some promising results and aim to open a pr this week :) |
Real-Life got in my way, but I am back on track. I got a quick question on my progress. After some digging, my current approach is adding the parameter to the resolve_anchor_pos function like this: (Somewhat cut short for brevity, it is analogous to the snippet done above). resolver.resolve_anchor_pos = function(anchor, p_width, p_height, max_columns, max_lines, anchor_padding)
anchor = anchor:upper()
local pos = { 0, 0 }
if anchor == "CENTER" then
return pos
end
if anchor:find "W" then
pos[1] = math.ceil((p_width - max_columns) / 2) + anchor_padding
elseif anchor:find "E" then This forces me to update all the tests. Is it sufficient to just call all the tests with 1 to mimic the old behavior, or should I add new tests? |
looks good, thanks Weyaaron. @jamestrew do you think you can take a look at PR as well? |
Description
This is driving me crazy. It would be awesome if i can vertical stack prompt, previewer, results and snap it to the bottom of the page. I don't want to use ivy because it doesn't allow vertical stacking. Take a look at the screenshot below. That line "27: opts.window = opts.window or {}" is the actual buffer i am on. Telescope is on top of that line, and status line is on the bottom. I expected vertical layout strategy with anchor=S to leave no line between telescope and statusline (this is what ivy does)
Neovim version
Operating system and version
Debian 11
Telescope version / branch / rev
telescope master
checkhealth telescope
Steps to reproduce
opts.layout_strategy = "vertical"
opts.border = true
opts.layout_config.anchor = "S"
opts.layout_config.prompt_position = "bottom"
opts.layout_config.width = {padding = 0}
opts.layout_config.height = 0.5
opts.layout_config.preview_height = 0.5
Expected behavior
Just like ivy theme, vertical layout strategy that is anchored to bottom of the window should be snapped right on top of statusline
Actual behavior
There is one annoying line between statusline and telescope
Minimal config
The text was updated successfully, but these errors were encountered: