Skip to content

Commit

Permalink
feat(plugins/plugin-client-common): Allow users to opt in to default …
Browse files Browse the repository at this point in the history
…meta-click behavior

Fixes #6406
  • Loading branch information
starpit committed Dec 15, 2020
1 parent 5d3f032 commit 3618acf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import whenNothingIsSelected from '../../../util/selection'

export type CellOnClickHandler = (evt: React.MouseEvent) => void

function XOR(a: boolean, b: boolean) {
return (a || b) && !(a && b)
}

/**
* Generate an onclick handler for a cell
*
Expand Down Expand Up @@ -66,7 +70,7 @@ export function onClickForCell(
return whenNothingIsSelected((evt: React.MouseEvent) => {
evt.stopPropagation()
selectRow()
if (evt.metaKey) {
if (XOR(evt.metaKey, !!process.env.KUI_SPLIT_DRILLDOWN)) {
pexecInCurrentTab(`split --ifnot is-split --cmdline "${handler}"`, undefined, false, true)
} else {
repl.pexec(handler, opts)
Expand Down

0 comments on commit 3618acf

Please sign in to comment.