Open dhnm opened 4 years ago
I have the same issue. @rouxfeur did you find a workaround? This prevents me from using this plugin with Sublime.
This problem is not just for QWERTZ, it also exists for QWERTY Canadian Multilingual layout (English+French), which is used for any "Canadian French language" Mac keyboard.
I do have a workaround which is to comment out that shortcut from the keyboard shortcuts file in the package source directory.
~/Library/Application\ Support/Sublime\ Text\ 3/Packages/TypeScript/Default.sublime-keymap
)Go to line 130 and comment out the rule for "alt+,"
:
}, // In case when auto match is enabled, only format if not within {}
// {
// "keys": [ "alt+,"],
// "command": "typescript_signature_popup",
// "context": [
// { "key": "selector", "operator": "equal", "operand": "source.ts, source.tsx, source.js, source.jsx" },
// { "key": "tooltip_supported", "operator": "equal", "operand": true}
// ]
// },
{
Spent so much time trying to figure this out, it should really be addressed. The workaround by @benwiley4000 does work until then.
@SlovakianCanon yep, it came back for me today because my workaround gets overwritten every time the plugin updates.
Wrote this script to fix this automatically from my zshfiles because this issue is the worst. It overwrites the keymap file, stripping the alt+,
shortcut
const fs = require('fs')
tryOrExit(main)
function main() {
const [keymapFile] = process.argv.slice(2)
const keymapJson = readFileOrExit(keymapFile)
// strip comments 🤷♂️
const keymapStripped = keymapJson.replace(/\/\/.*/mg, '')
const keymap = parseJsonOrExit(keymapStripped)
const nextKeymap = getNextKeymap(keymap)
const nextKeymapJson = JSON.stringify(nextKeymap, null, 2)
writeFileOrExit(keymapFile, nextKeymapJson + '\n')
}
function readFileOrExit(file) {
return tryOrExit(() => fs.readFileSync(file, 'utf8'))
}
function writeFileOrExit(file, contents) {
return tryOrExit(() => fs.writeFileSync(file, contents, 'utf8'))
}
function parseJsonOrExit(json) {
return tryOrExit(() => JSON.parse(json))
}
function getNextKeymap(keymap) {
return keymap.filter(definition => (
!Array.isArray(definition.keys) ||
definition.keys.length !== 1 ||
definition.keys[0] !== 'alt+,'
))
}
function tryOrExit(fn) {
try {
return fn()
} catch (_err) {
// rule of silence
process.exit(0)
}
}
Usage:
node hacks/autofix-sublime-typescript-plugin ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/TypeScript/Default.sublime-keymap
Example: https://github.com/bevacqua/dotfiles/commit/585dfddba7478738a20d9df64b35e2e7d67e4f36
When
Alt+,
is pressed,typescript_signature_popup
command is called, preventing me from typing<
symbol on QWERTZ keyboard.