Skip to content
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

fix: check if tabline is present when calculating certain layouts #1027

Merged
merged 4 commits into from
Jul 20, 2021

Conversation

l-kershaw
Copy link
Contributor

@l-kershaw l-kershaw commented Jul 18, 2021

  • Don't include tabline in the height of the window when present.
    • Only applies to horizontal, vertical and center strategies (also inherited by flex)
  • Tweaks height calculation for center strategy

Closes #995

- also tweaks height calculation for `center` strategy
- will reimplement something similar in another PR for a few of the strategies
@l-kershaw
Copy link
Contributor Author

I've removed the tweak for the center strategy.
I think I want the tweak to be more precise, and also apply it to some other layouts, so will put it in a separate PR when I get a chance.

@l-kershaw
Copy link
Contributor Author

I've found a problem with the vertical strategy, and some other refactoring to do.
Will hopefully fix today

@Conni2461
Copy link
Member

Are you still working on this?
My comment would be. "I think i see a reoccurring pattern, maybe a short local function(max_lines) -> max_lines, tbln"

Otherwise LGTM (you dont need to do it. I shouldn't be that nitpicky)

- also tweaked `vertical` calculations so that no `nil` check is required
@l-kershaw
Copy link
Contributor Author

@Conni2461 I have factored out the function you suggested (good spot!), also considered factoring out the "shift down a line if have a tabline", but thought it would be more trouble than it was worth.

I'm happy with this now, but if you could have a last look over before merging, that would be great 😊

Copy link
Member

@Conni2461 Conni2461 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks :)

you can ship it if its done. I felt the same about the second refactoring. I also thought it would complicate things.

@l-kershaw l-kershaw merged commit d057b10 into nvim-telescope:master Jul 20, 2021
@l-kershaw l-kershaw deleted the fix/layout_with_tabline branch July 20, 2021 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vertical padding does not take tabline into account
2 participants