mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 03:25:03 +03:00
GH-297 Rename callback and add changeBufferList action
This commit is contained in:
parent
7376b22da4
commit
3090ba83a3
@ -572,7 +572,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
}
|
||||
|
||||
case NeoVimServerMsgIdBufferEvent:
|
||||
[_bridge buffersChanged];
|
||||
[_bridge bufferListChanged];
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)setIcon:(NSString *)icon;
|
||||
- (void)setDirtyStatus:(bool)dirty;
|
||||
- (void)cwdChanged;
|
||||
- (void)buffersChanged;
|
||||
- (void)bufferListChanged;
|
||||
|
||||
/**
|
||||
* NeoVim has been stopped.
|
||||
|
@ -1417,9 +1417,9 @@ extension NeoVimView {
|
||||
}
|
||||
}
|
||||
|
||||
public func buffersChanged() {
|
||||
public func bufferListChanged() {
|
||||
DispatchUtils.gui {
|
||||
self.delegate?.buffersChanged()
|
||||
self.delegate?.bufferListChanged()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,5 +12,5 @@ public protocol NeoVimViewDelegate: class {
|
||||
func set(title: String)
|
||||
func set(dirtyStatus: Bool)
|
||||
func cwdChanged()
|
||||
func buffersChanged()
|
||||
func bufferListChanged()
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ enum MainWindowAction {
|
||||
case becomeKey(mainWindow: MainWindowComponent)
|
||||
case openQuickly(mainWindow: MainWindowComponent)
|
||||
case changeCwd(mainWindow: MainWindowComponent)
|
||||
case changeBufferList(mainWindow: MainWindowComponent, buffers: [NeoVimBuffer])
|
||||
case close(mainWindow: MainWindowComponent, mainWindowPrefData: MainWindowPrefData)
|
||||
}
|
||||
|
||||
@ -73,7 +74,12 @@ struct MainWindowPrefData: StandardPrefData {
|
||||
}
|
||||
}
|
||||
|
||||
class MainWindowComponent: WindowComponent, NSWindowDelegate, NSUserInterfaceValidations, WorkspaceDelegate {
|
||||
class MainWindowComponent: WindowComponent,
|
||||
NeoVimViewDelegate,
|
||||
NSWindowDelegate,
|
||||
NSUserInterfaceValidations,
|
||||
WorkspaceDelegate
|
||||
{
|
||||
|
||||
fileprivate static let nibName = "MainWindow"
|
||||
|
||||
@ -417,7 +423,7 @@ extension MainWindowComponent {
|
||||
}
|
||||
|
||||
// MARK: - NeoVimViewDelegate
|
||||
extension MainWindowComponent: NeoVimViewDelegate {
|
||||
extension MainWindowComponent {
|
||||
|
||||
func neoVimStopped() {
|
||||
self.windowController.close()
|
||||
@ -440,8 +446,8 @@ extension MainWindowComponent: NeoVimViewDelegate {
|
||||
self.publish(event: MainWindowAction.changeCwd(mainWindow: self))
|
||||
}
|
||||
|
||||
func buffersChanged() {
|
||||
NSLog("buffer changed")
|
||||
func bufferListChanged() {
|
||||
NSLog("buffer changed to: \(self.neoVimView.allBuffers())")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,9 @@ class MainWindowManager: StandardFlow {
|
||||
|
||||
case .changeCwd:
|
||||
break
|
||||
|
||||
case .changeBufferList:
|
||||
break;
|
||||
}
|
||||
})
|
||||
.addDisposableTo(self.disposeBag)
|
||||
|
Loading…
Reference in New Issue
Block a user