Context lines for content matches
When searching file content with c/..., I can open the preview pane and then cycle through matches, but I only get the exact line that matched. I'd really like to have the matching line centered in a regular preview and to be able to cycle through the matches that way. Alternatively, having n lines of context before and after the match (like rg) would be nice.
In the same vein, this might require separate verbs for previous_match_in_file and next_match_in_file, as this would make line_up and line_down operate on file lines rather than match lines.
Right now, the way to cycle is to do another ctrl-right to see the text at the match position, then ctrl-left to see all matches. I describe it there: https://dystroy.org/blog/broot-c-search/
But cycling with a key is an interesting idea that I should try.
A configurable option for $n$ lines of context would really help. For my use case, I often deal with Markdown files, which have nested lists. Just seeing the child item isn't very helpful without also seeing the line above.
You mean when a file containing one or several matches is selected, you'd like to initially have in the right panel not just the matching lines but to have them surrounded by some context ?
(this may have been the initial request and I didn't understand it)
You mean when a file containing one or several matches is selected, you'd like to initially have in the right panel not just the matching lines but to have them surrounded by some context ?
Yes that's what I mean. I believe this was the initial request. So see $n$ lines before and after the matching line.
@9999years @stevenxxiu Can you check PR https://github.com/Canop/broot/pull/866 ?
@stevenxxiu Why did you remove your comment ? It made sense to me.
Ah I just moved it to the PR.