sublimehq/sublime_text

Charactes from `word_separators` are stripped at the beginning of tab triggers

Opened this issue · 3 comments

{
  "scope": "text.plain",
  "completions":
  [
    "\"text|some\thint\ttab",
    "\"text without hint",
    "ttt\"",
    "t\"tt"
  ]
}

2015-02-19_14 38 17

Note that it works as expected when " appears somewhere else in the string.

Other characters like @ have the same issue.

I generalized the issue title. Following are more precise reproduction steps (on build 4074):

{
  "scope": "source, text",
  "completions":
  [
    {"trigger": "\\trigger", "contents": "\\trigger"},
    {"trigger": "$var", "contents": "\\$var"},
    {"trigger": "\"text\"", "contents": "\"text\""},
  ]
}

Entering each of the triggers with the special characters, you notice that the tab trigger does not include the leading character. Selecting their completion results in the following:

\\trigger
$$var
""text"

Removing \\\"$ from the global word_separators setting makes the special characters show up in the completion popup and also properly inserts the remaining text.

\trigger
$var
"text

I don't know if this is working exactly as intended, so I'll leave this issue open until a dev comments on it.

Caused by #4901