From 4ce2134d46ba7535280f77eb6bf5235e68869fe2 Mon Sep 17 00:00:00 2001 From: Jan Paepke Date: Thu, 13 May 2021 13:48:38 +0200 Subject: [PATCH] extended docs to show conditional shortcut execution I had other extensions using the same shortcut I wanted to use for duplication, so I had to find out how to make it conditional so that it would only run, when I focus the file in the explorer. Thought this might be helpful information for other users as well. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 58ab449..8d1b799 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,16 @@ To change keyboard shortcuts, create a new rule in `File -> Preferences -> Keybo } ``` +In case of shortcut overlaps you might want to specify a when clause, for example "only when the file explorer is in focus": + +```json +{ + "key": "ctrl+shift+d", + "command": "duplicate.execute", + "when": "explorerViewletFocus" +} +``` + ## Changelog See the [Releases section of our GitHub project](https://github.com/mrmlnc/vscode-duplicate/releases) for changelogs for each release version.