mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
fix: temp value was dropped
This commit is contained in:
parent
ead5ffc49c
commit
b8aa7d5fce
1 changed files with 3 additions and 2 deletions
|
@ -6,11 +6,12 @@ pub trait OperationFactory {
|
||||||
|
|
||||||
fn replace(&self, txt: &str) -> OperationSeq {
|
fn replace(&self, txt: &str) -> OperationSeq {
|
||||||
let mut out = OperationSeq::default();
|
let mut out = OperationSeq::default();
|
||||||
if self.content() == txt {
|
let content = self.content();
|
||||||
|
if content == txt {
|
||||||
return out; // TODO this won't work, should we return a noop instead?
|
return out; // TODO this won't work, should we return a noop instead?
|
||||||
}
|
}
|
||||||
|
|
||||||
let diff = TextDiff::from_chars(self.content().as_str(), txt);
|
let diff = TextDiff::from_chars(content.as_str(), txt);
|
||||||
|
|
||||||
for change in diff.iter_all_changes() {
|
for change in diff.iter_all_changes() {
|
||||||
match change.tag() {
|
match change.tag() {
|
||||||
|
|
Loading…
Reference in a new issue