Contribute to folke/snacks.nvim
25-07-12Permalink
Learning ProgressPermalink
- ✅ Submitted first PR to snacks.nvim project
- ✅ Fixed smartcase highlighting bug in nvim picker component
- ✅ Wrote and tested Lua utility function
Open Source Contribution - snacks.nvimPermalink
Today I submitted a PR to the snacks.nvim project.
Problem Solved: Issue #2043 - Inconsistent smartcase search pattern highlighting between picker’s preview and list components
Implemented Solution:
- Created utility function:
prepare_highlight_pattern()
inpicker/util/init.lua
- Removes regex prefix flags (
(?i)
,(?-i)
) - Supports flexible pattern trimming
- Provides optional case-insensitive regex flag insertion
- Removes regex prefix flags (
- Updated core files:
preview.lua
: Implemented consistent case-insensitive highlighting logiclist.lua
: Integrated utility function for regex matcher initialization
- Key improvements:
- Unified pattern processing between list and preview components
- Proper smartcase handling with mixed-case search patterns
- Enhanced handling of grep flags
Impact: Ensures consistent highlighting behavior between search results list and file preview, significantly improving user experience
ReferencesPermalink
- snacks.nvim GitHub Repository
- PR #2044: fix(picker): properly handle smartcase, grep flag highlighting
- Issue #2043: Inconsistent highlighting behavior
ThoughtsPermalink
Even though I’m relatively new to nvim, it was really rewarding to contribute to such a meaningful project. It’s impressive how open source communities welcome contributions from developers at all skill levels, and I hope this feature helps other nvim users improve their workflow.
Comments