Skip to content

Conversation

@BerniSc
Copy link

@BerniSc BerniSc commented Dec 5, 2025

Hi! First off, I just want to say I really love this plugin - it's made navigating codebases in Neovim so much more enjoyable. Thank you for all your work!

Motivation

I often want to see different symboltypes depending on context (sometimes just classes and functions, other times variables etc). Dynamic filtering in the outline sidebar makes this much easier.

What This Adds

  • Interactive filtermenu to toggle which symbol kinds are shown.
  • Configurable picker backend (default uses vim.ui.select (no real extra-dependencies), or telescope).
  • Checkmarks for enabled kinds in the picker.

Screenshots

Defaultpicker with dressing.nvim setup for ui-select:

grafik

Telescope-picker:

grafik

In Action

OutlineDynamicFilterInAction

I'd love to hear your thoughts and feedback. If you think this could fit with the plugin’s direction, I'm happy to make any changes or help further!

Thanks again!

First draft of dynamic filterselection for outline-sidebar using
telescope
…menu UX

- Added `picker` option to config for selecting filterpicker backend
(`default` or `telescope`)
- Implemented generic pickermodules: `default` (using `vim.ui.select`)
and `telescope`
- Refactored sidebar filtermenu to use configurable pickerbackend, with
fallback to default if unavailable
- Enhanced filtermenu display: prepend checkmark to enabled kinds, sort
enabled kinds above disabled, and keep "all"/"none" at the top
- Updated README with new `filter_menu` keybind, picker config, and
improved filter menu documentation
Copilot AI review requested due to automatic review settings December 5, 2025 17:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds dynamic filter selection functionality to outline.nvim, allowing users to interactively toggle which symbol kinds are displayed in the outline sidebar. The implementation provides a picker interface with two backend options: a dependency-free default picker using vim.ui.select, and an optional Telescope integration for enhanced UI.

Key changes:

  • Interactive filter menu accessible via configurable keybind (default: 'f')
  • Modular picker architecture supporting multiple backends (default/telescope)
  • Visual checkmarks in picker to indicate enabled symbol kinds

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lua/outline/sidebar.lua Adds _pick_filter() method for filter selection, tracks current buffer in self.curbuf, registers new filter_menu keymap action
lua/outline/pickers/default.lua Implements picker using vim.ui.select (no external dependencies)
lua/outline/pickers/telescope.lua Implements picker using Telescope for enhanced UI experience
lua/outline/config.lua Adds picker configuration option (default: 'default') and filter_menu keymap default
doc/outline.txt Documents the new filter menu feature, keymap, and picker configuration
README.md Updates README with filter menu documentation and usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kinds[kind] = false
end
else
-- Toggle singlechoice-Keys
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment "Toggle singlechoice-Keys" is unclear. Consider changing to "Toggle individual symbol kind" for clarity.

Suggested change
-- Toggle singlechoice-Keys
-- Toggle individual symbol kind

Copilot uses AI. Check for mistakes.
Comment on lines 980 to 982
end,
}
self:_update_lines(true)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The _update_lines call executes immediately, but picker.pick_item is asynchronous. The outline will be refreshed before the user makes a selection, so the filter changes won't be visible. Move this call inside the on_select callback (after line 979) to refresh the outline after the filter is actually updated.

Suggested change
end,
}
self:_update_lines(true)
self:_update_lines(true)
end,
}

Copilot uses AI. Check for mistakes.

local newbuf = self:refresh_setup()

self.curbuf = curbuf
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The self.curbuf field is redundant since self.code.buf already tracks the current buffer. Consider using self.code.buf directly in line 931 instead of introducing a new field. If you choose to keep self.curbuf, it should be documented in the outline.Sidebar class definition (around line 19-30) and initialized in Sidebar:new() and Sidebar:reset_state().

Suggested change
self.curbuf = curbuf

Copilot uses AI. Check for mistakes.
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.

1 participant