nvim-focus / focus.nvim

Auto-Focusing and Auto-Resizing Splits/Windows for Neovim written in Lua. A full suite of window management enhancements. Vim splits on steroids!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is the first window bigger?

CoderKeung opened this issue · comments

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 }
  }
commented

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 .

Thank you for your response !!!!!

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

three windows:
Tree

more windows:
Tree2

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. 😂

commented

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

commented

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

See my config (I used nvim tree)

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

commented

Closing as stale issue