mirror of
https://github.com/solaeus/nucleo.git
synced 2024-12-22 09:57: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 {
|
fn parse(raw: &str, normalize: bool, case: CaseMatching) -> PatternAtom {
|
||||||
let mut atom = raw;
|
let mut atom = raw;
|
||||||
let inverse = atom.starts_with('!');
|
let invert = atom.starts_with('!');
|
||||||
if inverse {
|
if invert {
|
||||||
atom = &atom[1..];
|
atom = &atom[1..];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,11 +150,13 @@ impl PatternAtom {
|
|||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
||||||
if inverse && kind == PatternKind::Fuzzy {
|
if invert && kind == PatternKind::Fuzzy {
|
||||||
kind = PatternKind::Substring
|
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