diff options
-rw-r--r-- | helix-term/src/commands.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 87c496ce..2f071306 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -654,8 +654,13 @@ where range.head }; - search_fn(text, ch, search_start_pos, count, inclusive) - .map_or(range, |pos| range.put_cursor(text, pos, extend)) + search_fn(text, ch, search_start_pos, count, inclusive).map_or(range, |pos| { + if extend { + range.put_cursor(text, pos, true) + } else { + Range::point(range.cursor(text)).put_cursor(text, pos, true) + } + }) }); doc.set_selection(view.id, selection); }) |