mirror of
https://github.com/solaeus/nucleo.git
synced 2024-12-22 01:47:49 +00:00
fix negative matching
This commit is contained in:
parent
ccacf9798c
commit
bb0b5f8726
@ -116,8 +116,8 @@ impl PatternAtom {
|
||||
|
||||
fn parse(raw: &str, normalize: bool, case: CaseMatching) -> PatternAtom {
|
||||
let mut atom = raw;
|
||||
let inverse = atom.starts_with('!');
|
||||
if inverse {
|
||||
let invert = atom.starts_with('!');
|
||||
if invert {
|
||||
atom = &atom[1..];
|
||||
}
|
||||
|
||||
@ -150,11 +150,13 @@ impl PatternAtom {
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if inverse && kind == PatternKind::Fuzzy {
|
||||
if invert && kind == PatternKind::Fuzzy {
|
||||
kind = PatternKind::Substring
|
||||
}
|
||||
|
||||
PatternAtom::literal(atom, normalize, case, kind, true)
|
||||
let mut pattern = PatternAtom::literal(atom, normalize, case, kind, true);
|
||||
pattern.invert = invert;
|
||||
pattern
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user