feat: add cursorlineopt config option for styling livegrep file preview#262
Merged
dmtrKovalenko merged 2 commits intoFeb 28, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new config.preview.cursorlineopt option to control how the cursorline is highlighted in the live_grep preview window, improving match readability in grep previews.
Changes:
- Introduces
preview.cursorlineoptconfiguration with default'both'. - Applies the configured
cursorlineoptto the preview window when in grep mode. - Documents the new option in
README.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lua/fff/picker_ui.lua | Sets cursorlineopt on the preview window in grep mode using resolved config value. |
| lua/fff/conf.lua | Adds preview.cursorlineopt to config schema + default config. |
| README.md | Documents the new preview.cursorlineopt option in the setup example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dmtrKovalenko
approved these changes
Feb 28, 2026
Owner
dmtrKovalenko
left a comment
There was a problem hiding this comment.
It has always highlighted the line for me and I can't see any difference with the code but it makes sense so I'll just merge it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my first time contributing not only Lua code but also to a Neovim plugin, please let me know if changes are needed.
Summary
The live_grep file preview only highlights the current line number in the file preview instead of the entire line. I was having a tough time picking out which line matched my grep query in the file preview. I figured other people might like this feature too, so I decided to implement this as a config option that others can use.
I added the
cursorlineoptproperty to theconfig.previewtable since I figure it makes the most sense there (I can move it somewhere else if desired). The config option follows Neovim'scursorlineoptrules which can be found here. Ifcursorlineoptis not set, or if an invalid option is provided, thencursorlineoptdefaults toboth(as opposed to defaulting to whatever the global value ofcursorlineoptis set to, which seems to be what fff.nvim currently does)Before

After (using

cursorlineopt = both)