fix(ui): prevent re-applying style='minimal' on float UI#373
Merged
Conversation
…at update Move `style = 'minimal'` from `base_config()` to `open_win()` so it only applies during initial window creation via `nvim_open_win`. Previously, `base_config()` included `style = 'minimal'` which was shared by both `open_win()` and `update()`. Every time `update()` called `nvim_win_set_config`, it re-applied `style = 'minimal'`, resetting window-local options like `signcolumn` and `foldcolumn` back to their minimal defaults. This caused the float window to lose its left gutter (signcolumn + foldcolumn) after any resize or dimension update, unlike the split layout which correctly retained these options.
Owner
|
Thanks for the fix. |
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.
Fixes a bug where the float layout re-applies
style = 'minimal'afterupdate_dimensions, resetting window-local options that were explicitly set byoutput_window.setup().Problem
When using
position = "float", window options likesigncolumn = 'yes'andfoldcolumn = '1'(set byoutput_window.setup()) get reset to'auto'and'0'. This happens because:output_window.setup()setssigncolumn = 'yes'andfoldcolumn = '1'update_dimensions()is called immediately afterfloat_layout.update()→nvim_win_set_config()re-appliesstyle = 'minimal'frombase_config()style = 'minimal'resetssigncolumnandfoldcolumnback to their minimal defaultsThis causes the floating window to lose its left gutter, unlike the split layout which correctly retains these options.
Fix
Move
style = 'minimal'frombase_config()intoopen_win()so it only applies during the initialnvim_open_win()call, not during subsequentnvim_win_set_config()updates.