-
Notifications
You must be signed in to change notification settings - Fork 15
mod for side panel mode and buffer copy #12
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,8 @@ local config = { | |||||||||||||||||||||||||
| cmd = 'codex', | ||||||||||||||||||||||||||
| model = nil, -- Default to the latest model | ||||||||||||||||||||||||||
| autoinstall = true, | ||||||||||||||||||||||||||
| panel = false, -- if true, open Codex in a side-panel instead of floating window | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| panel = false, -- if true, open Codex in a side-panel instead of floating window | |
| panel = false, -- if true, open Codex in a side-panel instead of floating window |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The open_panel() function uses vim.cmd('vertical rightbelow vsplit') which creates a new empty buffer before switching to state.buf. This temporarily creates an unnecessary buffer. Consider using vim.api.nvim_open_win(state.buf, true, {...}) with appropriate split configuration, or explicitly delete the temporary buffer after the split.
| local win = vim.api.nvim_get_current_win() | |
| vim.api.nvim_win_set_buf(win, state.buf) | |
| local win = vim.api.nvim_get_current_win() | |
| local tmp_buf = vim.api.nvim_win_get_buf(win) | |
| vim.api.nvim_win_set_buf(win, state.buf) | |
| -- Delete the temporary buffer if it's not the same as state.buf and is listed | |
| if tmp_buf ~= state.buf and vim.api.nvim_buf_is_valid(tmp_buf) then | |
| -- Only delete if the buffer is listed (to avoid deleting user buffers) | |
| if vim.api.nvim_buf_get_option(tmp_buf, 'buflisted') then | |
| vim.api.nvim_buf_delete(tmp_buf, { force = true }) | |
| end | |
| end |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The inline comment -- assemble command should be capitalized and end with a period for consistency with documentation standards: -- Assemble command.
| -- assemble command | |
| -- Assemble command. |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The on_stdout, on_stderr, and on_exit callbacks don't verify that state.buf is still valid before writing to it. If the user closes the buffer while the job is still running, nvim_buf_set_lines will throw an error. Add a buffer validity check:
if not vim.api.nvim_buf_is_valid(state.buf) then return endat the start of each callback.
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using use_buffer = true, the buffer is not a terminal buffer, so users cannot interact with the Codex CLI (send input). The jobstart call doesn't configure stdin handling. If the Codex CLI requires user input, consider either:
- Adding
stdin = 'pipe'and implementing an input mechanism - Documenting that
use_buffer = trueis read-only and doesn't support interactive sessions - Using
pty = trueto enable terminal-like behavior while still capturing output
Currently, this creates a non-interactive experience that may not work correctly with Codex CLI.
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Inconsistent inline comment style. Line 175 uses -- capture stdout/stderr into normal buffer (lowercase, no period) while line 203 uses -- use a terminal buffer (lowercase, no period). For consistency with the function-level comment on line 88 which uses proper capitalization and punctuation, consider standardizing all comments to use sentence case with proper punctuation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code block syntax is malformed. Line 54 shows `}````, which combines the closing brace with the three backticks. These should be on separate lines for proper markdown formatting:
(closing backticks on next line)