FuzzyFilePath icon indicating copy to clipboard operation
FuzzyFilePath copied to clipboard

How to "replace_on_insert" on key binding, not auto_complete_trigger

Open kud opened this issue 5 years ago • 1 comments

Hey,

I've got a lil problem.

replace_on_insert works like a charm when it's auto_complete_trigger ed like:

{
  "debug": false,
  "exclude_folders": ["node_modules", "bower_components", "src_legacy", "dist"],
  "additional_scopes": [
    {
      // es6 import from/import "*"
      "scope": "string.quoted.double.js.fjsx15",

      "auto": true,
      "relative": false,
      "base_directory": false,
      "prefix": ["from", "import"],
      "extensions": ["ts", "js", "html", "scss", "json"],
      "replace_on_insert": [
        ["/src/", "~/"],
        ["\\.(js|ts)$", ""],
        ["([^.])\\/index$", "\\1"],
        ["^([\\/.]+)?\\/(bower_components|node_modules)\\/", ""]
      ]
    }
  ]
}
"auto_complete_triggers":
	[
		{
			"characters": "abcdefghijklmnopqrstuvwxyz",
			"selector": "string.quoted.double.js.fjsx15"
		}
	],

but when I use the keyboard combo, the replace_on_insert doesn't apply, do you know why?

Kapture 2019-08-02 at 1 11 38

kud avatar Aug 01 '19 23:08 kud

Actually no. I am using the default rule for this scope and the regex gets applied for absolute and relative insertions. Do you run on windows or get any error messages in the console?

sagold avatar Sep 08 '19 13:09 sagold