Repository navigation
[audit] Tab-indent gap in scope guide; wrong enter flag in tmp float win - #346
Draft
stanfish06 wants to merge 1 commit into
Draft
stanfish06 wants to merge 1 commit into
stanfish06 wants to merge 1 commit into
Conversation
…at win scopeline.lua only treated a literal space or end-of-line as safe to overlay the guide character on, so any line indented with a tab (Go, Makefiles, tab-indented C/C++) broke the vertical guide. Match any whitespace instead. lib/ui.lua's create_tmp_float_window passed 0 for nvim_open_win's enter arg; Lua only treats nil/false as falsy; 0 is truthy, so the window was being focused. Pass false explicitly. Currently dead code (only called from a commented-out line in image.lua) but worth fixing before it's wired back up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wr1z5B5VfZPgBAw7mnan8i
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.
What
Two small, unrelated mechanical fixes found during this audit pass.
1.
lua/config/scopeline.lua:50-52— scope guide skips tab-indented lineschar_atonly overlays the guide (│/┌/└) when the character at the guide's column is a literal space or past end-of-line. A tab character fails both checks, so the vertical scope-guide never renders on any line whose indentation at that column is a tab — which hits Go (gofmt default), Makefiles, and any tab-indented C/C++, all explicitly listed invalid_scopes. Distinct from the already-open "snacks.nvim indent/scope chunks and scopeline.lua extmarks render on the same column" issue, which is about column collision with another plugin, not character-type detection.Fix: match any whitespace (
char:match("%s")) instead of only" ".2.
lua/lib/ui.lua:15—nvim_open_win(buf, 0, opts)focuses the window instead of leaving it unfocusedThe second arg to
nvim_open_winisenter(boolean).0reads like C-style "false", but Lua's truthiness only treatsnil/falseas falsy —0is truthy, so this call actually focuses the new floating window, the opposite of what's presumably wanted for a disposable scratch/preview window.Fix: pass
falseexplicitly.Note:
create_tmp_float_windowis currently dead code — its only reference is a commented-out line inlua/config/image.lua:5— so this has no live effect today, but it's latent and will resurface if image-preview work (already tracked by other open issues) revives this helper.Why it matters
Both are one-line, behavior-preserving-except-for-the-bug fixes with no API/config shape changes. No nerd font/icon strings touched.
Recommended action
Merge directly.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Wr1z5B5VfZPgBAw7mnan8i
Generated by Claude Code