vim fixes for find&replace (#2995)

* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext (in vim mode)

Release Notes:

- allow replacement to be empty
This commit is contained in:
Conrad Irwin
2023-09-20 16:42:39 -06:00
committed by GitHub
3 changed files with 16 additions and 17 deletions
+2 -2
View File
@@ -159,7 +159,7 @@ impl SearchQuery {
)
}
}
pub fn with_replacement(mut self, new_replacement: Option<String>) -> Self {
pub fn with_replacement(mut self, new_replacement: String) -> Self {
match self {
Self::Text {
ref mut replacement,
@@ -169,7 +169,7 @@ impl SearchQuery {
ref mut replacement,
..
} => {
*replacement = new_replacement;
*replacement = Some(new_replacement);
self
}
}