Skip to content

refactor: DRY cleanup across lua modules#22

Merged
cachebag merged 1 commit into
masterfrom
cleanup
May 24, 2026
Merged

refactor: DRY cleanup across lua modules#22
cachebag merged 1 commit into
masterfrom
cleanup

Conversation

@cachebag
Copy link
Copy Markdown
Owner

  • Fix tags.rel_path call to use path.rel_path in prompt.lua
  • Replace custom trim with vim.trim fallback in tags.lua
  • Replace custom split_lines with vim.split fallback in patch.lua
  • Replace manual array copy with shallow_copy helper in patch.lua
  • Add MENTION_CHARS constant in tags.lua, use in prompt.lua
  • Extract scan_mentions() to unify find_mentions/strip_mentions
  • Use path.rel_path in context-tools.lua instead of manual cwd math
  • Extract build_virt_lines helper in render.lua
  • Extract build_curl_cmd base function in llm.lua
  • Hoist repeated notify strings to constants in navigate.lua
  • Convert keymaps to table-driven loop in init.lua

Codebase grew quite a bit this week. Figured I'd take the time to go through it with Sonnet 4.6 and clean things up that I didn't like.

- Fix tags.rel_path call to use path.rel_path in prompt.lua
- Replace custom trim with vim.trim fallback in tags.lua
- Replace custom split_lines with vim.split fallback in patch.lua
- Replace manual array copy with shallow_copy helper in patch.lua
- Add MENTION_CHARS constant in tags.lua, use in prompt.lua
- Extract scan_mentions() to unify find_mentions/strip_mentions
- Use path.rel_path in context-tools.lua instead of manual cwd math
- Extract build_virt_lines helper in render.lua
- Extract build_curl_cmd base function in llm.lua
- Hoist repeated notify strings to constants in navigate.lua
- Convert keymaps to table-driven loop in init.lua
@cachebag cachebag requested a review from LOTaher May 24, 2026 04:45
@cachebag cachebag self-assigned this May 24, 2026
@cachebag cachebag added the refactor Internal cleanup, no behavior change label May 24, 2026
Copy link
Copy Markdown
Collaborator

@LOTaher LOTaher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cachebag cachebag merged commit 2c5e4b0 into master May 24, 2026
3 checks passed
@cachebag cachebag deleted the cleanup branch May 24, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Internal cleanup, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants