1
1
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:
Tae Won Ha 2016-11-21 23:13:38 +01:00
parent 7376b22da4
commit 3090ba83a3
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
6 changed files with 18 additions and 9 deletions

View File

@ -572,7 +572,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
}
case NeoVimServerMsgIdBufferEvent:
[_bridge buffersChanged];
[_bridge bufferListChanged];
return;
default:

View File

@ -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.

View File

@ -1417,9 +1417,9 @@ extension NeoVimView {
}
}
public func buffersChanged() {
public func bufferListChanged() {
DispatchUtils.gui {
self.delegate?.buffersChanged()
self.delegate?.bufferListChanged()
}
}

View File

@ -12,5 +12,5 @@ public protocol NeoVimViewDelegate: class {
func set(title: String)
func set(dirtyStatus: Bool)
func cwdChanged()
func buffersChanged()
func bufferListChanged()
}

View File

@ -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())")
}
}

View File

@ -51,6 +51,9 @@ class MainWindowManager: StandardFlow {
case .changeCwd:
break
case .changeBufferList:
break;
}
})
.addDisposableTo(self.disposeBag)