diff --git a/CHANGELOG.md b/CHANGELOG.md index 5db0e559e..c5aebc91d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ develop ### Fixes +- Fix an issue where the regular expression didn't handle `\v` metacharacter correctly. - Fix an issue where the selection of encoding menu in toolbar didn't restore to the previous one when encoding reinterpretation was failed. - [AppStore ver.] Fix an issue where acknowledgement window was empty. diff --git a/CotEditor/Sources/TextFind.swift b/CotEditor/Sources/TextFind.swift index 73955ddbc..32059640e 100644 --- a/CotEditor/Sources/TextFind.swift +++ b/CotEditor/Sources/TextFind.swift @@ -85,8 +85,18 @@ final class TextFind { } if settings.usesRegularExpression { + let sanitizedFindString: String = { + // replace `\v` with `\u000b` + // -> Because NSRegularExpression cannot handle `\v` correctly. (2017-07 on macOS 10.12) + // cf. https://github.com/coteditor/CotEditor/issues/713 + if findString.contains("\\v") { + return findString.replacingOccurrences(of: "(?