mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 11:37:32 +03:00
Handle move tab to last index
This commit is contained in:
parent
08bc90ad9c
commit
f63f6cdb7e
@ -485,6 +485,7 @@ extension NvimView {
|
||||
|
||||
switch event.stringValue {
|
||||
case "tabline_update": self.tablineUpdate(args)
|
||||
case "win_viewport": self.winViewportUpdate(args)
|
||||
default: break
|
||||
}
|
||||
}
|
||||
@ -600,6 +601,9 @@ extension NvimView {
|
||||
gui.async { self.tabBar?.update(tabRepresentatives: self.tabEntries) }
|
||||
}
|
||||
|
||||
func winViewportUpdate(_ args: [MessagePackValue]) {
|
||||
}
|
||||
|
||||
private func bufferWritten(_ handle: Int) {
|
||||
self
|
||||
.currentBuffer()
|
||||
|
@ -171,9 +171,11 @@ public class NvimView: NSView,
|
||||
.subscribe()
|
||||
.disposed(by: db)
|
||||
}
|
||||
self.tabBar?.reorderHandler = { [weak self] index, _, _ in
|
||||
self.tabBar?.reorderHandler = { [weak self] index, _, entries in
|
||||
// I don't know why, but `tabm ${last_index}` does not always work.
|
||||
let command = (index == entries.count - 1) ? "tabm" : "tabm \(index)"
|
||||
self?.api
|
||||
.command(command: "tabm \(index)")
|
||||
.command(command: command)
|
||||
.subscribe()
|
||||
.disposed(by: db)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user