editor: add tabs for controlling open/active files

This commit is contained in:
David Lechner
2022-04-07 21:17:09 -05:00
parent 56858390ca
commit 8ac77560fb
20 changed files with 1289 additions and 118 deletions
+6 -1
View File
@@ -54,6 +54,11 @@ const specialCases: Record<string, string> = {
};
function addWhichToKeyboardEvent(e: KeyboardEvent) {
// blueprints and testing-library both don't do this one
if (e.key === 'ContextMenu') {
return;
}
const blueprintsKeyName = specialCases[e.key] ?? e.key.toLowerCase();
let which = 0;
@@ -65,7 +70,7 @@ function addWhichToKeyboardEvent(e: KeyboardEvent) {
}
if (which === 0) {
console.warn('unsupported key:', e.key);
console.warn('unsupported key:', e.key, e.code);
}
Object.defineProperty(e, 'which', { value: which });