Skip to content

Conversation

@subev
Copy link

@subev subev commented Dec 26, 2025

Summary

  • Adds a new clear_on_escape configuration option that allows users to clear reference highlights by pressing Escape or Ctrl-C
  • The implementation uses vim.on_key() to listen for these keys without blocking them, providing a non-intrusive way to dismiss highlights
  • The option is disabled by default to maintain backwards compatibility

Test plan

  • Enable the option with highlights = { clear_on_escape = true }
  • Jump to references and verify highlights appear
  • Press Escape or Ctrl-C and verify highlights are cleared
  • Verify that Escape/Ctrl-C still work normally in other contexts

Add a new `clear_on_escape` option that allows users to clear reference
highlights by pressing Escape or Ctrl-C. The implementation uses vim.on_key()
to listen for these keys without blocking them, providing a non-intrusive
way to dismiss highlights.

The option is disabled by default to maintain backwards compatibility.
- Add new counter.lua module to display [X/Y] reference count
- Show counter as virtual text at end of line when jumping
- Counter clears automatically when highlights are cleared
- Configurable via counter.enable and counter.hl_group options
- Default styling: bold orange text for high visibility
Copy link
Owner

@mawkler mawkler left a comment

Choose a reason for hiding this comment

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

Thanks for adding this! I'll leave this open until #9 is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants