mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 19:47:41 +03:00
GH-296 Refactor slightly
This commit is contained in:
parent
5a337b6b5b
commit
2c839446fe
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user