Fixing search-replace replace to allow empty string insert

This commit is contained in:
itdominator 2025-07-05 00:14:04 -05:00
parent a99cbc4cad
commit f647aba153

View File

@ -209,7 +209,7 @@ export class SearchReplaceComponent {
let fromStr = this.findEntryElm.nativeElement.value; let fromStr = this.findEntryElm.nativeElement.value;
let toStr = this.replaceEntryElm.nativeElement.value; let toStr = this.replaceEntryElm.nativeElement.value;
if (!fromStr || !toStr) return; if (!fromStr) return;
let totalCount = this.editor.replace(toStr, fromStr, { let totalCount = this.editor.replace(toStr, fromStr, {
backwards: this.isBackwards, backwards: this.isBackwards,
@ -228,7 +228,7 @@ export class SearchReplaceComponent {
let fromStr = this.findEntryElm.nativeElement.value; let fromStr = this.findEntryElm.nativeElement.value;
let toStr = this.replaceEntryElm.nativeElement.value; let toStr = this.replaceEntryElm.nativeElement.value;
if (!fromStr || !toStr) return; if (!fromStr) return;
let totalCount = this.editor.replaceAll(toStr, fromStr, { let totalCount = this.editor.replaceAll(toStr, fromStr, {
backwards: this.isBackwards, backwards: this.isBackwards,