IME // +RangeReplaceableCollection <- ctlPrefWindow.
This commit is contained in:
parent
8d651739e4
commit
6b688c691c
|
@ -225,3 +225,14 @@ import Cocoa
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Root Extensions
|
||||||
|
|
||||||
|
// Extend the RangeReplaceableCollection to allow it clean duplicated characters.
|
||||||
|
// Ref: https://stackoverflow.com/questions/25738817/
|
||||||
|
extension RangeReplaceableCollection where Element: Hashable {
|
||||||
|
var charDeDuplicate: Self {
|
||||||
|
var set = Set<Element>()
|
||||||
|
return filter { set.insert($0).inserted }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -27,14 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
import Carbon
|
import Carbon
|
||||||
import Cocoa
|
import Cocoa
|
||||||
|
|
||||||
// Extend the RangeReplaceableCollection to allow it clean duplicated characters.
|
|
||||||
extension RangeReplaceableCollection where Element: Hashable {
|
|
||||||
var charDeDuplicate: Self {
|
|
||||||
var set = Set<Element>()
|
|
||||||
return filter { set.insert($0).inserted }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Please note that the class should be exposed using the same class name
|
// Please note that the class should be exposed using the same class name
|
||||||
// in Objective-C in order to let IMK to see the same class name as
|
// in Objective-C in order to let IMK to see the same class name as
|
||||||
// the "InputMethodServerPreferencesWindowControllerClass" in Info.plist.
|
// the "InputMethodServerPreferencesWindowControllerClass" in Info.plist.
|
||||||
|
|
Loading…
Reference in New Issue