##// END OF EJS Templates
Cleaning up and only doing latex completion for python 3.
Brian E. Granger -
Show More
@@ -596,13 +596,12 b' class IPCompleter(Completer):'
596 #= re.compile(r'[\s|\[]*(\w+)(?:\s*=?\s*.*)')
596 #= re.compile(r'[\s|\[]*(\w+)(?:\s*=?\s*.*)')
597
597
598 # All active matcher routines for completion
598 # All active matcher routines for completion
599 self.matchers = [
599 self.matchers = [self.python_matches,
600 self.python_matches,
600 self.file_matches,
601 self.file_matches,
601 self.magic_matches,
602 self.magic_matches,
602 self.python_func_kw_matches,
603 self.python_func_kw_matches,
603 self.dict_key_matches,
604 self.dict_key_matches,
604 ]
605 ]
606
605
607 def all_completions(self, text):
606 def all_completions(self, text):
608 """
607 """
@@ -1057,10 +1056,11 b' class IPCompleter(Completer):'
1057 if cursor_pos is None:
1056 if cursor_pos is None:
1058 cursor_pos = len(line_buffer) if text is None else len(text)
1057 cursor_pos = len(line_buffer) if text is None else len(text)
1059
1058
1060 latex_text = text if not line_buffer else line_buffer[:cursor_pos]
1059 if PY3:
1061 latex_text, latex_matches = self.latex_matches(latex_text)
1060 latex_text = text if not line_buffer else line_buffer[:cursor_pos]
1062 if latex_matches:
1061 latex_text, latex_matches = self.latex_matches(latex_text)
1063 return latex_text, latex_matches
1062 if latex_matches:
1063 return latex_text, latex_matches
1064
1064
1065 # if text is either None or an empty string, rely on the line buffer
1065 # if text is either None or an empty string, rely on the line buffer
1066 if not text:
1066 if not text:
@@ -165,7 +165,6 b' define(['
165 Completer.prototype.finish_completing = function (msg) {
165 Completer.prototype.finish_completing = function (msg) {
166 // let's build a function that wrap all that stuff into what is needed
166 // let's build a function that wrap all that stuff into what is needed
167 // for the new completer:
167 // for the new completer:
168 console.log(msg);
169 var content = msg.content;
168 var content = msg.content;
170 var start = content.cursor_start;
169 var start = content.cursor_start;
171 var end = content.cursor_end;
170 var end = content.cursor_end;
General Comments 0
You need to be logged in to leave comments. Login now