question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin blocks Alt+,

See original GitHub issue

When Alt+, is pressed, typescript_signature_popup command is called, preventing me from typing < symbol on QWERTZ keyboard.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
benwiley4000commented, Feb 12, 2020

I do have a workaround which is to comment out that shortcut from the keyboard shortcuts file in the package source directory.

  1. Open the file (on macOS it’s at ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/TypeScript/Default.sublime-keymap)
  2. 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}
    
    //     ]
    // },
    {
    
  3. Save and restart Sublime.
0reactions
bevacquacommented, Mar 2, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alt blocker plugin | SpigotMC - High Performance Minecraft
and boost themself. so I'm looking for a plugin to block alt accounts to make it fair.
Read more >
Auto generating alt tags in “Featured Image” – Block break
Hi, stackable featured image block is adding the wrong alt tags, instead of adding alt tags from media, it is entering an… ......
Read more >
Fix Alt Text: A WordPress Plugin Guide and Review
The Settings tab of the Fix Alt Text plugin, with options for what blocks are. If you have a new WordPress site, or...
Read more >
Image
Add an Image control to your custom Gutenberg block using the Lazy Blocks WordPress plugin. ... alt, Optional alt attribute used in <img>...
Read more >
Markdown | IntelliJ IDEA Documentation
Press Ctrl+Alt+S to open the IDE settings and select Plugins. ... If you specify the language for the code block, by default, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found