Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit d1a55be

Browse files
author
Andy Bayer
committed
rewrite/organize logic for deselecting
1 parent 0500e91 commit d1a55be

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/tree-view.coffee

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,17 @@ class TreeView extends View
738738
onMouseDown: (e) ->
739739
e.stopPropagation()
740740

741-
# return early if we're opening a contextual menu (right click) during multi-select mode
742-
if @multiSelectEnabled() and e.currentTarget.classList.contains('selected') and not e.metaKey
743-
return
741+
if @multiSelectEnabled() and e.currentTarget.classList.contains('selected')
742+
# return early if we're opening a contextual menu (right click) during multi-select mode
743+
if (e.button is 2 or e.ctrlKey and process.platform is 'darwin')
744+
return
745+
# return early unless we're deselecting an entry (metaKey on OSX, ctrl/metaKey on linux/windows)
746+
if process.platform is 'darwin'
747+
if not e.metaKey
748+
return
749+
else if process.platform isnt 'darwin'
750+
if not (e.ctrlKey or e.metaKey)
751+
return
744752

745753
entryToSelect = e.currentTarget
746754

0 commit comments

Comments
 (0)