mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-13 00:20:08 +01:00
refactor: Match -> textbuf/matches.rs
This commit is contained in:
parent
f76ed75f5b
commit
7d4d9a8824
3 changed files with 14 additions and 12 deletions
10
src/textbuf/matches.rs
Normal file
10
src/textbuf/matches.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/// 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,
|
||||
pub pattern: &'a str,
|
||||
pub text: &'a str,
|
||||
pub hint: String,
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
mod matches;
|
||||
mod model;
|
||||
mod raw_match;
|
||||
|
||||
pub use model::{Match, Model};
|
||||
pub use matches::Match;
|
||||
pub use model::Model;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ use std::collections;
|
|||
use regex::Regex;
|
||||
use sequence_trie::SequenceTrie;
|
||||
|
||||
use super::matches::Match;
|
||||
use super::raw_match::RawMatch;
|
||||
use crate::alphabets::Alphabet;
|
||||
use crate::regexes::{NamedPattern, EXCLUDE_PATTERNS, PATTERNS};
|
||||
|
|
@ -228,17 +229,6 @@ 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,
|
||||
pub pattern: &'a str,
|
||||
pub text: &'a str,
|
||||
pub hint: String,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue