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

feat: add focused window minwidth and minheight options #171

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrZeLee
Copy link

@MrZeLee MrZeLee commented Mar 4, 2025

Adds options to set minimum width and height for the focused window. This allows users to customize the size of the focused window.

Missing tests and probably something else... If anyone has any pointers, I can continue working on this.

Motivation: I have a normal screen, but sometimes I have multiple windows with buffers open. I wanted to ensure that the focused window has at least 80 characters in width to read Markdown files comfortably.

Hope this helps the repository, which, by the way, is awesome!

@cryptomilk
Copy link
Collaborator

Thank you very much for your contribution!

I think we could add that as long as it has tests :-) Writing tests is pretty easy, just look at the existing ones.

@MrZeLee
Copy link
Author

MrZeLee commented Mar 9, 2025

I was running some tests and wondered: if focusedwindow_minwidth is set and minwidth is also set in the config, and the sum of both exceeds max_width, what should be the default behavior?

Should we give priority to the focused window and ignore the minwidth, or ignore the focused window and adhere to the minwidth?

In my opinion, it should give priority to the focused window. For now is set to give priority to the focused window min value.

@MrZeLee
Copy link
Author

MrZeLee commented Mar 9, 2025

@cryptomilk Added tests for the new options. I believe these tests sufficiently cover the new functionality, but if additional tests are required, please let me know and I'll add them. In my opinion, this PR is ready to merge.

MrZeLee added 2 commits March 9, 2025 22:47
Adds options to set minimum width and height for the focused window.
This allows users to customize the size of the focused window.
Testing focusedwindow_minwidth and focusedwindow_minheight when value is bigger and smaller then the expected width and height value from golden ratio function. Testing integration of focusedwindow_minwidth and focusedwindow_minheight with minwidth and minheight values.
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.

2 participants