Conversation
|
This was the original behavior, but it's annoying when you're searching for something offscreen: if I search for a method via Maybe some type of smart behavior would be nice? (center if next match is offscreen, otherwise don't move the screen) |
This way is better. I'll change to it |
|
Already. |
|
Looks good 👍🏻 Can you update the PR, looks like there's a merge conflict? |
It has rebased master and conflicts are resolved. |
| pub fn ensure_cursor_in_view(&mut self, doc: &Document, scrolloff: usize) { | ||
| if let Some((row, col)) = self.offset_coords_to_in_view(doc, scrolloff) { | ||
| self.offset.row = row; | ||
| self.offset.col = col; | ||
| } | ||
| } | ||
|
|
||
| pub fn is_cursor_in_view(&mut self, doc: &Document, scrolloff: usize) -> bool { | ||
| self.offset_coords_to_in_view(doc, scrolloff).is_none() | ||
| } |
There was a problem hiding this comment.
Do we really need to call offset_coords_to_in_view twice?
There was a problem hiding this comment.
Scrolloff is different between two calls.
I don't have idea to merge two calls.
I often use
searchto move cursor to pos I aready know and keep my eyes on it.Currenly helix always align cursor to center that cause Eyes lost the pos.
This PR will only align cursor center when it isn't in view.
Previous:
After: