mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-16 09:53:50 +01:00
feat: capture wrapped lines
This commit is contained in:
parent
45a4083547
commit
193dca67e3
3 changed files with 71 additions and 27 deletions
23
src/model.rs
23
src/model.rs
|
|
@ -1,5 +1,4 @@
|
|||
use std::collections;
|
||||
use std::fmt;
|
||||
|
||||
use regex::Regex;
|
||||
use sequence_trie::SequenceTrie;
|
||||
|
|
@ -227,6 +226,7 @@ impl<'a> Model<'a> {
|
|||
|
||||
/// Represents matched text, its location on screen, the pattern that created
|
||||
/// it, and the associated hint.
|
||||
#[derive(Debug)]
|
||||
pub struct Match<'a> {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
|
|
@ -235,17 +235,8 @@ pub struct Match<'a> {
|
|||
pub hint: String,
|
||||
}
|
||||
|
||||
impl<'a> fmt::Debug for Match<'a> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"Match {{ x: {}, y: {}, pattern: {}, text: {}, hint: <{}> }}",
|
||||
self.x, self.y, self.pattern, self.text, self.hint,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Internal surrogate for `Match`, before a Hint has been associated.
|
||||
#[derive(Debug)]
|
||||
struct RawMatch<'a> {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
|
|
@ -253,16 +244,6 @@ struct RawMatch<'a> {
|
|||
pub text: &'a str,
|
||||
}
|
||||
|
||||
impl<'a> fmt::Debug for RawMatch<'a> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"RawMatch {{ x: {}, y: {}, pattern: {}, text: {} }}",
|
||||
self.x, self.y, self.pattern, self.text,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue