deadgrep icon indicating copy to clipboard operation
deadgrep copied to clipboard

Jump to exact point of search term

Open AtomicNess123 opened this issue 3 years ago • 1 comments

When clicking ENTER in a search result, the cursor does not point exactly at the searched term. If it's an orgmode buffer with many headings and subheadings, it will just point to the higher heading, so I would have to search below. Is this the expected behaviour?

AtomicNess123 avatar Feb 23 '22 11:02 AtomicNess123

The cursor should move to the exact place, this might be an issue when using deadgrep with org-mode. Did you have the heading collapsed? Do you have a repro I can play with?

Wilfred avatar Apr 12 '23 19:04 Wilfred

What I see is that the point will end up (column-wise) in the buffer wherever it was in the search buffer. In other words, it doesn't end up (for me) where the match is, but rather where my point is (which is almost always at start of line). I created #149 to introduce a variable to control the behavior since the current behavior seems intentional.

gvol avatar Apr 07 '24 15:04 gvol

OK, I think a better behaviour is to jump to the first match if point is on the line number, but otherwise respect the column position. This feels nice to me, play with it and tell me what you think :)

Wilfred avatar Apr 08 '24 15:04 Wilfred