feat: remove winfixbuf and make ctrl w o work in opencode window - #479
Closed
jugarpeupv wants to merge 3 commits into
Closed
feat: remove winfixbuf and make ctrl w o work in opencode window#479jugarpeupv wants to merge 3 commits into
jugarpeupv wants to merge 3 commits into
Conversation
Remove winfixbuf from output/input windows so that file pickers (telescope, snacks, fyler) and :e can switch the buffer without E1513 errors. Extend the BufEnter teardown guard to all positions. When the buffer is replaced externally, keep the output window open with the new file buffer instead of closing it, so the file remains visible after opencode UI tears down.
Only teardown opencode UI when the output window itself closes, not when input/footer closes. Add <C-w>o mapping to both output and input buffers using buffer-ID comparison to avoid nil-table issues in the window-ID approach.
Contributor
Author
|
Increase vim.wait timeout from 50ms to 100ms for the multiline initial_text cursor position assertion, which is prone to timing out on macos-latest with Neovim 0.11.4.
Contributor
Author
|
This does not work well either X.X |
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.
Remove winfixbuf from output/input windows so that file pickers (telescope, snacks, fyler) and :e can switch the buffer without E1513 errors. Extend the BufEnter teardown guard to all positions.
When the buffer is replaced externally, keep the output window open with the new file buffer instead of closing it, so the file remains visible after opencode UI tears down.
Summary
When
winfixbuf=truewas set on opencode output/input windows (split and float positions), any attempt to switch the buffer via file pickers (telescope, snacks, fyler) or:ewould throwE1513: Cannot switch buffer. 'winfixbuf' is enabled— a hard error with no graceful recovery.Solution
Three coordinated changes:
winfixbuf=truefrom output and input windows — lets external tools switch the buffer without E1513.BufEnterteardown guard to all positions — was previously conditional onposition == 'current'. Now detects when a non-opencode buffer enters an opencode window and tears down the UI cleanly.close_or_restore_output_windownow checks if the buffer already changed before closing the window. If it was replaced by fyler/telescope/etc., the window stays open with the new file buffer visible.Files changed
lua/opencode/ui/output_window.luawinfixbuf=truefor non-currentpositionslua/opencode/ui/input_window.luawinfixbuf=truefor non-currentpositionslua/opencode/ui/autocmds.luaBufEnterteardown guard apply to all positions (wascurrent-only)lua/opencode/ui/ui.luaclose_or_restore_output_window: detect buffer replacement, keep window openBehaviour
:e filein opencode windowE1513errorE1513errorE1513error