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

GH-296 Refactor slightly

This commit is contained in:
Tae Won Ha 2016-11-18 08:40:01 +01:00
parent 5a337b6b5b
commit 2c839446fe
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -333,11 +333,11 @@ extension ProxyBar {
// 2.
if draggedOnToolIdx > toolIdx {
(toolIdx..<draggedOnToolIdx).forEach { swap(&self.container!.tools[$0], &self.container!.tools[$0 + 1]) }
self.container!.tools.remove(at: toolIdx)
self.container!.tools.insert(tool, at: draggedOnToolIdx - 1)
} else {
(draggedOnToolIdx..<toolIdx).reversed().forEach {
swap(&self.container!.tools[$0 + 1], &self.container!.tools[$0])
}
self.container!.tools.remove(at: toolIdx)
self.container!.tools.insert(tool, at: draggedOnToolIdx)
}
return true
}