1
0
mirror of https://github.com/chylex/IntelliJ-Keyboard-Master.git synced 2025-10-17 11:39:36 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
f3a3685084 Release version 0.5.8 2024-08-05 03:55:32 +02:00
5e654762fc Fix vim-style navigation not scrolling after collapsing a tree node 2024-08-05 03:55:14 +02:00
2 changed files with 8 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ plugins {
} }
group = "com.chylex.intellij.keyboardmaster" group = "com.chylex.intellij.keyboardmaster"
version = "0.5.7" version = "0.5.8"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@@ -70,15 +70,20 @@ internal object VimTreeNavigation {
val path = tree.selectionPath ?: return val path = tree.selectionPath ?: return
if (tree.isExpanded(path)) { if (tree.isExpanded(path)) {
tree.collapsePath(path) collapseAndScroll(tree, path)
} }
else { else {
val parentPath = path.parentPath val parentPath = path.parentPath
if (parentPath.parentPath != null || tree.isRootVisible) { 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>> { private data object ExpandTreeNodeChildrenToNextLevel : ActionNode<VimNavigationDispatcher<JTree>> {