diff options
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 12 | ||||
-rw-r--r-- | alacritty_terminal/src/term/search.rs | 18 |
2 files changed, 23 insertions, 7 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 4113ed9c..5dfd880c 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1445,15 +1445,15 @@ impl<T: EventListener> Handler for Term<T> { /// edition, in LINE FEED mode, /// /// > The execution of the formatter functions LINE FEED (LF), FORM FEED - /// (FF), LINE TABULATION (VT) cause only movement of the active position in - /// the direction of the line progression. + /// > (FF), LINE TABULATION (VT) cause only movement of the active position in + /// > the direction of the line progression. /// /// In NEW LINE mode, /// /// > The execution of the formatter functions LINE FEED (LF), FORM FEED - /// (FF), LINE TABULATION (VT) cause movement to the line home position on - /// the following line, the following form, etc. In the case of LF this is - /// referred to as the New Line (NL) option. + /// > (FF), LINE TABULATION (VT) cause movement to the line home position on + /// > the following line, the following form, etc. In the case of LF this is + /// > referred to as the New Line (NL) option. /// /// Additionally, ECMA-48 4th edition says that this option is deprecated. /// ECMA-48 5th edition only mentions this option (without explanation) @@ -2187,7 +2187,7 @@ impl<T: EventListener> Handler for Term<T> { fn set_title(&mut self, title: Option<String>) { trace!("Setting title to '{:?}'", title); - self.title = title.clone(); + self.title.clone_from(&title); let title_event = match title { Some(title) => Event::Title(title), diff --git a/alacritty_terminal/src/term/search.rs b/alacritty_terminal/src/term/search.rs index 585e191c..a5ae9337 100644 --- a/alacritty_terminal/src/term/search.rs +++ b/alacritty_terminal/src/term/search.rs @@ -293,12 +293,12 @@ impl<T> Term<T> { let mut state = regex.dfa.start_state_forward(&mut regex.cache, &input).unwrap(); let mut iter = self.grid.iter_from(start); - let mut last_wrapped = false; let mut regex_match = None; let mut done = false; let mut cell = iter.cell(); self.skip_fullwidth(&mut iter, &mut cell, regex.direction); + let mut last_wrapped = cell.flags.contains(Flags::WRAPLINE); let mut c = cell.c; let mut point = iter.point(); @@ -1155,4 +1155,20 @@ mod tests { assert_eq!(start, Point::new(Line(1), Column(0))); assert_eq!(end, Point::new(Line(1), Column(2))); } + + #[test] + fn inline_word_search() { + #[rustfmt::skip] + let term = mock_term("\ + word word word word w\n\ + ord word word word\ + "); + + let mut regex = RegexSearch::new("word").unwrap(); + let start = Point::new(Line(1), Column(4)); + let end = Point::new(Line(0), Column(0)); + let match_start = Point::new(Line(0), Column(20)); + let match_end = Point::new(Line(1), Column(2)); + assert_eq!(term.regex_search_left(&mut regex, start, end), Some(match_start..=match_end)); + } } |