mirror of https://github.com/helix-editor/helix
Fix incorrect behavior of `find_char` command and friends.
The non-extending variants of the commands weren't selecting from the range head. Fixes #527.pull/530/head
parent
3fda350494
commit
e6e0d31be0
|
@ -654,8 +654,13 @@ where
|
||||||
range.head
|
range.head
|
||||||
};
|
};
|
||||||
|
|
||||||
search_fn(text, ch, search_start_pos, count, inclusive)
|
search_fn(text, ch, search_start_pos, count, inclusive).map_or(range, |pos| {
|
||||||
.map_or(range, |pos| range.put_cursor(text, pos, extend))
|
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);
|
doc.set_selection(view.id, selection);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue