From d07479bb4511669056cf18e54e0fc0a12af79e20 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Fri, 5 Dec 2014 17:15:35 +0300 Subject: [PATCH] [vcs-log] fix multiple selection with space --- .../intellij/vcs/log/ui/VcsStructureChooser.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsStructureChooser.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsStructureChooser.java index 303720a40f53..9191e3bfdf2b 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsStructureChooser.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsStructureChooser.java @@ -229,11 +229,15 @@ public class VcsStructureChooser extends DialogWrapper { myTree.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { - TreePath treePath = myTree.getLeadSelectionPath(); - if (treePath == null) return; - final Object o = treePath.getLastPathComponent(); - if (myRoot == o || getFile(o) == null) return; - mySelectionManager.toggleSelection((DefaultMutableTreeNode)o); + TreePath[] paths = myTree.getSelectionPaths(); + if (paths == null) return; + for (TreePath path : paths) { + if (path == null) continue; + final Object o = path.getLastPathComponent(); + if (myRoot == o || getFile(o) == null) return; + mySelectionManager.toggleSelection((DefaultMutableTreeNode)o); + } + myTree.revalidate(); myTree.repaint(); e.consume();