mirror of
https://github.com/chylex/IntelliJ-Keyboard-Master.git
synced 2025-04-21 14:15:43 +02:00
Fix vim-style navigation not scrolling after collapsing a tree node
This commit is contained in:
parent
723b8af939
commit
5e654762fc
@ -70,15 +70,20 @@ internal object VimTreeNavigation {
|
||||
val path = tree.selectionPath ?: return
|
||||
|
||||
if (tree.isExpanded(path)) {
|
||||
tree.collapsePath(path)
|
||||
collapseAndScroll(tree, path)
|
||||
}
|
||||
else {
|
||||
val parentPath = path.parentPath
|
||||
if (parentPath.parentPath != null || tree.isRootVisible) {
|
||||
tree.collapsePath(parentPath)
|
||||
collapseAndScroll(tree, parentPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun collapseAndScroll(tree: JTree, path: TreePath) {
|
||||
tree.collapsePath(path)
|
||||
tree.scrollRowToVisible(tree.getRowForPath(path))
|
||||
}
|
||||
}
|
||||
|
||||
private data object ExpandTreeNodeChildrenToNextLevel : ActionNode<VimNavigationDispatcher<JTree>> {
|
||||
|
Loading…
Reference in New Issue
Block a user