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:
parent
6b0e147b64
commit
4db07f2672
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user