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

Why is the first window bigger? #67

Closed
CoderKeung opened this issue Dec 14, 2021 · 6 comments
Closed

Why is the first window bigger? #67

CoderKeung opened this issue Dec 14, 2021 · 6 comments
Labels
good first issue Good for newcomers

Comments

@CoderKeung
Copy link

My questions are as follows:
image
But when I open nvim-tree, it's normal:
image
Here is my configuration:

  use {
    'beauwilliams/focus.nvim',
    cmd = { "FocusSplitNicely", "FocusSplitCycle" },
    module = "focus",
    config = { function() require("focus").setup({signcolumn = false,excluded_filetypes = { 'toggleterm', 'NvimTree'}, minwidth =  20}) end }
  }
@beauwilliams
Copy link
Collaborator

beauwilliams commented Dec 15, 2021

If you wish you can set the width greater than what it is by default.

The reason why the window was not completely 'crushed' in first screenshot is that there was available screen real estate and that was taken up by the very leftmost buffer.

When you added a 4th buffer window, the real estate available was diminished. So this appears to be expected behaviour

Can you try this, open 4 splits. It should give you same result as screenshot #2 .

@beauwilliams beauwilliams added the good first issue Good for newcomers label Dec 15, 2021
@CoderKeung
Copy link
Author

Thank you for your response !!!!!

This problem seems to occur only in the case of three windows.

three windows:
Tree

more windows:
Tree2

@CoderKeung
Copy link
Author

CoderKeung commented Dec 15, 2021

My configuration( minwidth = 30):

  use {
    disable = false,
    'beauwilliams/focus.nvim',
    cmd = { "FocusSplitNicely", "FocusToggle" },
    module = "focus",
    config = { function() require("focus").setup({signcolumn = false,excluded_filetypes = { 'NvimTree', 'diffview'}, minwidth = 30}) end }
  }

The version you suggested works well, but it doesn't work well with Nvim-tree. 😂

@beauwilliams
Copy link
Collaborator

Yeah so the first window will be bigger as this is how the vim core works when there is available screen real estate, it will expand the very leftmost window to take up the extra space.

Regarding the minwidth, that is also constrained too, as if there is not enough space available to support for example 3x windows @ 30 width + 1x window @ 150 width it will instead 'crush' the splits to fit into the display

@beauwilliams
Copy link
Collaborator

@CoderKeung there is no need to add nvim tree to excluded filetypes.

See my config (I used nvim tree)

excluded_filetypes = { 'fterm', 'term', 'diffviewfiles' },

@beauwilliams
Copy link
Collaborator

Closing as stale issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants