Use `^` and `$` to match the beginning and end of a line when searching (#1790)

Fixes #1737

Signed-off-by: nibon7 <nibon7@163.com>
imgbot
nibon7 3 years ago committed by GitHub
parent 61828ea519
commit 43997f1936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1642,6 +1642,7 @@ fn search_next_or_prev_impl(cx: &mut Context, movement: Movement, direction: Dir
let wrap_around = search_config.wrap_around; let wrap_around = search_config.wrap_around;
if let Ok(regex) = RegexBuilder::new(query) if let Ok(regex) = RegexBuilder::new(query)
.case_insensitive(case_insensitive) .case_insensitive(case_insensitive)
.multi_line(true)
.build() .build()
{ {
search_impl( search_impl(

@ -73,6 +73,7 @@ pub fn regex_prompt(
match RegexBuilder::new(input) match RegexBuilder::new(input)
.case_insensitive(case_insensitive) .case_insensitive(case_insensitive)
.multi_line(true)
.build() .build()
{ {
Ok(regex) => { Ok(regex) => {

Loading…
Cancel
Save