Skip to content

Commit 4e7c1c9

Browse files
authored
fix(defineShortcuts): allow meta_- shortcut (#4321)
1 parent 4b3dd48 commit 4e7c1c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/composables/defineShortcuts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
151151
// Parse key and modifiers
152152
let shortcut: Partial<Shortcut>
153153

154-
if (key.includes('-') && key !== '-' && !key.match(chainedShortcutRegex)?.length) {
154+
if (key.includes('-') && key !== '-' && !key.includes('_') && !key.match(chainedShortcutRegex)?.length) {
155155
console.trace(`[Shortcut] Invalid key: "${key}"`)
156156
}
157157

158158
if (key.includes('_') && key !== '_' && !key.match(combinedShortcutRegex)?.length) {
159159
console.trace(`[Shortcut] Invalid key: "${key}"`)
160160
}
161161

162-
const chained = key.includes('-') && key !== '-'
162+
const chained = key.includes('-') && key !== '-' && !key.includes('_')
163163
if (chained) {
164164
shortcut = {
165165
key: key.toLowerCase(),

0 commit comments

Comments
 (0)