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:

  1. Created utility function: prepare_highlight_pattern() in picker/util/init.lua
    • Removes regex prefix flags ((?i), (?-i))
    • Supports flexible pattern trimming
    • Provides optional case-insensitive regex flag insertion
  2. Updated core files:
    • preview.lua: Implemented consistent case-insensitive highlighting logic
    • list.lua: Integrated utility function for regex matcher initialization
  3. 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

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.

Tags:

Categories:

Updated:

Comments