Skip to content

feat: supports full view in multi-window mode - #2660

Merged
yetone merged 1 commit into
mainfrom
fix/full-view
Aug 31, 2025
Merged

feat: supports full view in multi-window mode#2660
yetone merged 1 commit into
mainfrom
fix/full-view

Conversation

@yetone

@yetone yetone commented Aug 31, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@yetone
yetone merged commit bcbe034 into main Aug 31, 2025
3 checks passed
@brookhong

Copy link
Copy Markdown
Collaborator

This does not work with me(neovim 0.11.3 on macOS), please try below steps

  1. launch nvim
  2. use :split to create another window
  3. press <leader>am to bring full view sidebar
  4. press <tab> to focus in result buffer
  5. press x, it does nothing, it should make sidebar narrow

And this also breaks x(toggle code window) in a single window, it works only for the first time, please try

  1. launch nvim
  2. press <leader>am to bring full view sidebar
  3. press <tab> to focus in result buffer
  4. press x to make sidebar narrow
  5. press x to make sidebar full
  6. press Esc to close sidebar
  7. press <leader>am to bring full view sidebar
  8. press <tab> to focus in result buffer
  9. now x does not work as expected

@aljam3h aljam3h mentioned this pull request Sep 1, 2025
@brookhong

Copy link
Copy Markdown
Collaborator

@yetone Please take a look.

dtor added a commit to dtor/avante.nvim that referenced this pull request Oct 10, 2025
Sidebar:toggle_code_window() attempts to handle case when there are
multiple non-sidebar windows are present but there are several issues
with it:

- checking whether we are running in "full" mode by checking width of
  the code window is not reliable as it may be only partially hidden
  (i.e. if transitioning from 3 windows formed by :split :vsplit
  sequence and going back to original larger window in which case it's
  width will be 2)

- it is not enough to only manipulate widths of windows, in vertical
  layout we need to reduce heights instead.

- trying to collect window sizes and minimize them in one pass may
  result in incorrect window sizes stored (they are changing as we are
  minimizing other ones)

- table containing old window sizes is not reset and may grow with time

Fix the issues by executing the toggle solely bases on the
self.is_in_full_view flag, manipulate with both width and height of
windows, and resetting stored sizes table and doing 2 passes over the
window list when minimizing.

Additionally do not try to collect window ids of sidebar containers and
use it do filter them out later (since vim.tbl_contains() is implemented
as a simple scan over elements in a table), but filter them out from the
beginning using vim.iter(), filter(), and
Sidebar:is_sidebar_container().

Fixes PR avante-corp#2660
dtor added a commit to dtor/avante.nvim that referenced this pull request Oct 11, 2025
Sidebar:toggle_code_window() attempts to handle case when there are
multiple non-sidebar windows are present but there are several issues
with it:

- checking whether we are running in "full" mode by checking width of
  the code window is not reliable as it may be only partially hidden
  (i.e. if transitioning from 3 windows formed by :split :vsplit
  sequence and going back to original larger window in which case it's
  width will be 2)

- trying to collect window sizes and minimize them in one pass may
  result in incorrect window sizes stored (they are changing as we are
  minimizing other ones)

- trying to minimize non-sidebar windows one by one causes unpredictable
  results when there are many windows

- table containing old window sizes is not reset and may grow with time

Fix the issues by executing the toggle solely bases on the
self.is_in_full_view flag, properly reset it when resettign the sidebar,
store and subsequently restore both width and height of windows, and
instead of minimizing non-sidebar windows maximize the sidebar's
"result" container that causes everything else to become minimized.

Additionally do not try to collect window ids of sidebar containers and
use it do filter them out later (since vim.tbl_contains() is implemented
as a simple scan over elements in a table), but filter them out from the
beginning using vim.iter(), filter(), and
Sidebar:is_sidebar_container().

Unfortunately this still may result in some weird window placement and
sizing issues as we are actively fighting neovim's internal algorithms
of automatic window resizing.

Fixes PR avante-corp#2660
gub-7 pushed a commit to gub-7/avante.nvim that referenced this pull request Mar 11, 2026
@teto
teto deleted the fix/full-view branch June 5, 2026 13:51
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