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

How do max_width and min_width of a window work ? #16

Closed
doubleChu opened this issue Aug 15, 2022 · 2 comments
Closed

How do max_width and min_width of a window work ? #16

doubleChu opened this issue Aug 15, 2022 · 2 comments

Comments

@doubleChu
Copy link

I wanted to set width with a default value so I won't have to press '[' to adjust the width of task_list every time.
Then I try to set max_width and min_width of task_list, I found if I set min_width to some value small enough like {10, 0,1}, I open the task_list, its width is the value of max_width.
This confuses me a lit bit, because in the beginning I thought min_width and max_width were used to limit the width when pressing '[' or ']'.
So may I ask which value would be adopted when I just 'OverseerOpen'? Or what is the best way to define a default width for the window like task_list?

@stevearc
Copy link
Owner

Ah, yes the comments/documentation on those is not great. I've added some more explanation so it should hopefully be clearer now. If you want to set a specific default width for the task list, use

require('overseer').setup({
  task_list = {
    width = 70, -- 70 columns wide
    -- width = 0.2, -- alternatively using a float, this will be 20% of the editor width
  }
})

The min_width and max_width constraints will then be applied after the default width is used. To disable them, you can set min_width = 0 and max_width = 0.99.

@doubleChu
Copy link
Author

With width = 0.2, min_width = 0 and max_width = 0.99 now it looks good. :)

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

No branches or pull requests

2 participants