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:
parent
a1d127f351
commit
70cfb2de7f
@ -299,6 +299,15 @@ extension NeoVimView {
|
||||
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() {
|
||||
self.exec(command: "q")
|
||||
}
|
||||
|
@ -254,8 +254,11 @@ class MainWindowComponent: WindowComponent,
|
||||
case let FileBrowserAction.setParentAsWorkingDirectory(url: url):
|
||||
self.neoVimView.cwd = url.parent
|
||||
|
||||
case let BufferListAction.open(buffer: buffer):
|
||||
self.neoVimView.select(buffer: buffer)
|
||||
|
||||
default:
|
||||
NSLog("unrecognized action: \(action)")
|
||||
NSLog("WARN unrecognized action: \(action)")
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user