1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

GH-297 React to publication

This commit is contained in:
Tae Won Ha 2016-11-23 21:46:31 +01:00
parent a1d127f351
commit 70cfb2de7f
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 13 additions and 1 deletions

View File

@ -299,6 +299,15 @@ extension NeoVimView {
urls.forEach { self.open($0, cmd: "vsp") } urls.forEach { self.open($0, cmd: "vsp") }
} }
public func select(buffer: NeoVimBuffer) {
for window in self.agent.tabs().map({ $0.windows }).flatMap({ $0 }) {
if window.buffer.handle == buffer.handle {
self.agent.select(window)
return
}
}
}
public func closeCurrentTab() { public func closeCurrentTab() {
self.exec(command: "q") self.exec(command: "q")
} }

View File

@ -254,8 +254,11 @@ class MainWindowComponent: WindowComponent,
case let FileBrowserAction.setParentAsWorkingDirectory(url: url): case let FileBrowserAction.setParentAsWorkingDirectory(url: url):
self.neoVimView.cwd = url.parent self.neoVimView.cwd = url.parent
case let BufferListAction.open(buffer: buffer):
self.neoVimView.select(buffer: buffer)
default: default:
NSLog("unrecognized action: \(action)") NSLog("WARN unrecognized action: \(action)")
return return
} }