mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
respect count for selecting next/previous match (#3056)
This commit is contained in:
parent
e6a6e251c5
commit
4418924ec3
@ -1687,6 +1687,7 @@ fn searcher(cx: &mut Context, direction: Direction) {
|
||||
}
|
||||
|
||||
fn search_next_or_prev_impl(cx: &mut Context, movement: Movement, direction: Direction) {
|
||||
let count = cx.count();
|
||||
let config = cx.editor.config();
|
||||
let scrolloff = config.scrolloff;
|
||||
let (view, doc) = current!(cx.editor);
|
||||
@ -1705,16 +1706,18 @@ fn search_next_or_prev_impl(cx: &mut Context, movement: Movement, direction: Dir
|
||||
.multi_line(true)
|
||||
.build()
|
||||
{
|
||||
search_impl(
|
||||
doc,
|
||||
view,
|
||||
&contents,
|
||||
®ex,
|
||||
movement,
|
||||
direction,
|
||||
scrolloff,
|
||||
wrap_around,
|
||||
);
|
||||
for _ in 0..count {
|
||||
search_impl(
|
||||
doc,
|
||||
view,
|
||||
&contents,
|
||||
®ex,
|
||||
movement,
|
||||
direction,
|
||||
scrolloff,
|
||||
wrap_around,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
let error = format!("Invalid regex: {}", query);
|
||||
cx.editor.set_error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user