Skip to content

Commit

Permalink
Fix word completions not displayed in completions panel (#160)
Browse files Browse the repository at this point in the history
fixes #158

The format of the "trigger" of the completions returned by a plugin
seems to influence the way Sublime Text merges them with word completions.

The extra spaces added to the "trigger" value, which make sure the hints
are displayed with enough distance to the label, cause Sublime Text
not to correctly merge in word completions.

To solve the issue, the `\t` is moved to the very left to prevent
a space to be appended to the label in the returned value.
  • Loading branch information
deathaxe authored and tomv564 committed Oct 7, 2017
1 parent 970b37e commit 0da08dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ def format_completion(self, item) -> 'Tuple[str, str]':
if insert_text[0] == '$': # sublime needs leading '$' escaped.
insert_text = '\$' + insert_text[1:]
# only return label with a hint if available
return " \t ".join((label, hint)) if hint else label, insert_text
return "\t ".join((label, hint)) if hint else label, insert_text

def handle_response(self, response):
global resolvable_completion_items
Expand Down

0 comments on commit 0da08dc

Please sign in to comment.