Support horizontal splits for focus_max_or_equal#162
Closed
jerryjrchen wants to merge 1 commit intonvim-focus:masterfrom
Closed
Support horizontal splits for focus_max_or_equal#162jerryjrchen wants to merge 1 commit intonvim-focus:masterfrom
jerryjrchen wants to merge 1 commit intonvim-focus:masterfrom
Conversation
At present it only checks for window width, which works for vertical splits. However, horizontal splits will not properly maximise since they will always have the max width, so attempts to focus_max_or_equal will always lead to focus_equalise.
Collaborator
|
Thank you very much for your contribution. Could you please add tests for it? Take a look at https://github.com/nvim-focus/focus.nvim/blob/master/tests/test_splits.lua
|
Contributor
Author
|
@cryptomilk I'd like to write a test for even vs odd row/col count window sizes, but I'm not super familiar with MiniTest and if there's a way to do that. What do you think about opening a floating window or something with fixed dimensions to do some split testing? |
Collaborator
|
That's all possible. See the |
Collaborator
|
Ping |
Collaborator
|
Superseded by #178 which includes a test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At present it only checks for window width, which works for vertical splits. However, horizontal splits will not properly maximise since they will always have the max width, so attempts to focus_max_or_equal will always lead to focus_equalise.
Minimal repro setup:
Repro:
nvim -u minimal_init.luabefore.mov
after.mov