From b8ba683c9d9aa203f13fcaab67ac6d18b188215b Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Thu, 2 Jun 2022 16:22:39 +0800 Subject: [PATCH] IME // Add expandingTildeInPath to String. - Also removes the same section from StringUtils. --- Source/Modules/ControllerModules/StringUtils.swift | 4 ---- Source/Modules/IMEModules/IME.swift | 11 +++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Modules/ControllerModules/StringUtils.swift b/Source/Modules/ControllerModules/StringUtils.swift index 135f56f5..dc997a42 100644 --- a/Source/Modules/ControllerModules/StringUtils.swift +++ b/Source/Modules/ControllerModules/StringUtils.swift @@ -63,10 +63,6 @@ extension String { return string[.. String { (self as NSString).substring(with: range) } diff --git a/Source/Modules/IMEModules/IME.swift b/Source/Modules/IMEModules/IME.swift index 4ae72006..e6648177 100644 --- a/Source/Modules/IMEModules/IME.swift +++ b/Source/Modules/IMEModules/IME.swift @@ -355,9 +355,16 @@ extension RangeReplaceableCollection where Element: Hashable { } } -// MARK: - Error Extension +// MARK: - String Tildes Expansion Extension + +extension String { + public var expandingTildeInPath: String { + (self as NSString).expandingTildeInPath + } +} + +// MARK: - String Localized Error Extension -extension String: Error {} extension String: LocalizedError { public var errorDescription: String? { self