Repository navigation
fix: address bugs found in config review - #172
Conversation
- conform: visual-mode format used stale '< '> marks (they only update on leaving visual mode), so it formatted the previous selection; let conform derive the live range itself - statusline: prune progress entries of dead LSP clients so the 100ms redraw timer can stop (a client that exits mid-progress never sends an "end" event, keeping the timer alive forever) - statusline: set laststatus=3 — %! evaluates in the focused window's context, so per-split statuslines all showed the focused buffer - statusline: replace Lua-pattern cwd matching in current_file with a plain prefix compare (dir names with '-' or '.' broke the old match) - statusline: escape '%' in file paths and git branch names; add the missing hl_alt to the unknown-mode fallback - lsp: make <leader>la buffer-local like gd instead of re-registering a global map on every LspAttach - pack: pass force=true to vim.pack.update() in headless mode, where the confirmation buffer would be silently discarded (README flow) - obsidian: set legacy_commands=false to silence the startup deprecation warning - fff: register the PackChanged rebuild hook unconditionally and guard the keymaps against fff being missing; fix "skiped" typo Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae461de2d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| end | ||
| require("fff.download").download_or_build_binary() | ||
| -- rebuild the rust binary whenever vim.pack installs/updates fff.nvim | ||
| vim.api.nvim_create_autocmd("PackChanged", { |
There was a problem hiding this comment.
Guard PackChanged on older Neovim
When this config runs on a Neovim build without vim.pack support, the old install path in plugins.lua is still intended to work, but plugin_config.lua now unconditionally registers the PackChanged event. On those versions the event is unknown, so nvim_create_autocmd('PackChanged', ...) raises during startup before any keymaps or plugin setup can continue. Keep this autocmd behind the same version/feature guard or restore the protective pcall so the non-vim.pack fallback remains usable.
Useful? React with 👍 / 👎.
Fixes the bugs identified in a full review of the config. No behavior changes beyond the fixes themselves.
Fixes
plugin_config.lua) — the'</'>marks only update after leaving visual mode, so the visual<leader>lfmapping formatted the previous selection. conform computes the live selection itself (getpos("v")/getpos(".")) when no explicit range is passed, so the two mappings collapse into one{ "n", "v" }mapping.statusline.lua) — a client that exits with a progress token in flight never sendskind == "end", solsp_progressstayed non-empty and the 100msredrawstatustimer never stopped. Dead clients' entries are now pruned in the timer callback.%!is evaluated in the current window's context (:h stl-%!), so withlaststatus=2every split displayed the focused buffer's file/branch/diagnostics. Now uses a single global statusline (laststatus=3), matching the existing design.current_fileLua-pattern matching (the in-codeBUGcomment) —home_path:find(root_dir)treated dir names as patterns:my-projectnever matched (-is a quantifier) and basenames likeconfigmatched.configfirst. Replaced with a plain string prefix compare against the window's cwd.%in file/branch names corrupted the statusline —statusline_escapeexisted but was only applied to LSP progress text; now also applied to file paths and branch names (e.g. a file named50%.md).%#nil#— the[?]mode entry was missinghl_alt.<leader>laleaked into a global mapping —LspAttachre-registered it globally on every attach; now buffer-local likegd.SyncPkgsnever applied updates —vim.pack.update()opens a confirmation buffer that the README'snvim --headless -c 'SyncPkgs' -c 'qa'flow silently discarded. Now passesforce = truewhen no UI is attached (verifiedupdate()blocks until checkout completes, so-c qais safe).legacy_commands = false(commands are now:Obsidian <subcommand>).fff_okdidn't actually test fff — it waspcall(nvim_create_autocmd), which always succeeds. The PackChanged rebuild hook is now registered unconditionally and the keymaps degrade to a warning if fff is missing. Also fixes the "skiped" typo.Verification
nvim --headless +messages +q— clean startup, obsidian warning gonecurrent_file: file under cwd rendersnvim/lua/config/options.lua; file outside cwd renders absolute/~path;/tmp/50%.mdrenders escaped (50%%.mdraw)<leader>lfmapped in both n and v modes;laststatusis 3<leader>laconfirmed buffer-local after luals attachstatusline.luauntouched (diff context verified)Not included (from the same review, left as follow-ups)
cnoreabbrev vimgrepexpanding in:help,:makevs:make!inCompile,DescribeKeyregister clobbering, per-buffersyntaxfallback, server.lua float polish, dead code inimage.lua/lib/ui.lua, startuplddshell-out,vim.pack.addat startup, scopelinevirt_text_win_col, and the async lib's sequential execution.🤖 Generated with Claude Code