1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 07:13:24 +03:00

Store preferences correctly

This commit is contained in:
Tae Won Ha 2017-01-01 17:14:54 +09:00
parent 6b0e147b64
commit 4db07f2672
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
3 changed files with 4 additions and 11 deletions

View File

@ -70,11 +70,11 @@ struct MainWindowPrefData: StandardPrefData {
}
func toolPrefData(for identifier: ToolIdentifier) -> ToolPrefData {
guard let tool = self.toolPrefDatas.filter({ $0.identifier == identifier }).first else {
guard let data = self.toolPrefDatas.filter({ $0.identifier == identifier }).first else {
preconditionFailure("[ERROR] No tool for \(identifier) found!")
}
return tool
return data
}
}

View File

@ -51,14 +51,7 @@ class PrefWindowComponent: WindowComponent, NSWindowDelegate, NSTableViewDataSou
return source
.filter { $0 is PrefData }
.map { $0 as! PrefData }
.subscribe(onNext: { [unowned self] prefData in
if prefData.appearance.editorFont == self.data.appearance.editorFont
&& prefData.appearance.editorUsesLigatures == self.data.appearance.editorUsesLigatures {
return
}
self.data = prefData
})
.subscribe(onNext: { [unowned self] prefData in self.data = prefData })
}
override func addViews() {

View File

@ -34,7 +34,7 @@ struct ToolPrefData: StandardPrefData {
toolData: FileBrowserData.default),
.bufferList: ToolPrefData(identifier: .bufferList,
location: .left,
isVisible: true,
isVisible: false,
dimension: 200,
toolData: EmptyPrefData.default),
]