fix: Crash with some find characters
fix: Warning on close of find dialog
This commit is contained in:
@@ -141,7 +141,14 @@ export default class FindAndReplace extends Extension {
|
||||
}
|
||||
|
||||
private get findRegExp() {
|
||||
return RegExp(this.searchTerm, !this.options.caseSensitive ? "gui" : "gu");
|
||||
try {
|
||||
return RegExp(
|
||||
this.searchTerm.replace(/\\+$/, ""),
|
||||
!this.options.caseSensitive ? "gui" : "gu"
|
||||
);
|
||||
} catch (err) {
|
||||
return RegExp("");
|
||||
}
|
||||
}
|
||||
|
||||
private goToMatch(direction: number): Command {
|
||||
|
||||
Reference in New Issue
Block a user