Wilfred / deadgrep

fast, friendly searching with ripgrep and Emacs
716 stars 46 forks source link

Jump to exact point of search term #112

Closed AtomicNess123 closed 6 months ago

AtomicNess123 commented 2 years ago

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?

Wilfred commented 1 year ago

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?

gvol commented 6 months ago

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.

Wilfred commented 6 months ago

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 :)