Steps to reproduce:
1 - create a new xml file with contents
2 - make sure it has XML syntax
3 - Write a new plugin: test.py
import sublime, sublime_plugin
class GoogleAutocomplete(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
return ((“test”,“test” ), (“test2”, “test”)])
4 - reload sublime
5 - enable logging by running “sublime.log_commands(True)” in the console
6 - go to xml document, place the cursor in between the two tags and press control+space
7 - select any of the options
8 - Instead of getting test you will be getting:
There is a bug in Sublime that when on XML syntax, code completion does not work since the selected competion is replaced by “\n $0\n”
Interesting enough if the tags has any character in between, for example an space: " " then the completion works and you get "test " and the log shows:
command: auto_complete
command: commit_completion
So it seems like a snippet completion is trigered on the return of the on_modified function instead of actually, running the completion.
please help/fix