def on_text_command(self, view, command_name, args):
		if command_name == 'olympic_funcs' and args['action'] == 'insert_pregen_class':
			sel = view.sel()[0]
			text_sel = view.line(sel)
			text = view.substr(text_sel)
			text = text.rstrip().lstrip()
			# print('kek', pregen_class(text))
			if pregen_class(text) is None:
				return ('insert_best_completion', {'exact': False, 'default': '\t'})
Example #2
0
 def on_text_command(self, view, command_name, args):
     if command_name == 'olympic_funcs' and args[
             'action'] == 'insert_pregen_class':
         sel = view.sel()[0]
         text_sel = view.line(sel)
         text = view.substr(text_sel)
         text = text.rstrip().lstrip()
         # print('kek', pregen_class(text))
         if pregen_class(text) is None:
             return ('insert_best_completion', {
                 'exact': False,
                 'default': '\t'
             })
	def on_query_completions(self, view, prefix, locations):
		print(prefix, locations)
		if not pregen_class(prefix) is None:
			print(pregen_class(prefix))
			return [(pregen_class(prefix), pregen_class(prefix))]
		return []
	def insert_pregen_class(self, edit):
		view = self.view
		w_sel = view.word(view.sel()[0])
		word = view.substr(w_sel).lstrip().rstrip()
		view.replace(edit, w_sel, pregen_class(word) + ' ')
Example #5
0
 def on_query_completions(self, view, prefix, locations):
     print(prefix, locations)
     if not pregen_class(prefix) is None:
         print(pregen_class(prefix))
         return [(pregen_class(prefix), pregen_class(prefix))]
     return []
Example #6
0
 def insert_pregen_class(self, edit):
     view = self.view
     w_sel = view.word(view.sel()[0])
     word = view.substr(w_sel).lstrip().rstrip()
     view.replace(edit, w_sel, pregen_class(word) + ' ')