##// END OF EJS Templates
Fix error in completer when the cursor position is at the start of a...
Ian Rose -
Show More
@@ -1129,11 +1129,12 b' class IPCompleter(Completer):'
1129 if self.global_namespace is not None:
1129 if self.global_namespace is not None:
1130 namespaces.append(self.global_namespace)
1130 namespaces.append(self.global_namespace)
1131
1131
1132 completion_filter = lambda x:x
1132 # cursor_pos is an it, jedi wants line and column
1133 # cursor_pos is an it, jedi wants line and column
1133 offset = cursor_to_position(text, cursor_line, cursor_column)
1134 offset = cursor_to_position(text, cursor_line, cursor_column)
1135 # filter output if we are completing for object members
1134 if offset:
1136 if offset:
1135 pre = text[offset-1]
1137 pre = text[offset-1]
1136 completion_filter = lambda x:x
1137 if pre == '.':
1138 if pre == '.':
1138 if self.omit__names == 2:
1139 if self.omit__names == 2:
1139 completion_filter = lambda c:not c.name.startswith('_')
1140 completion_filter = lambda c:not c.name.startswith('_')
@@ -1150,7 +1151,7 b' class IPCompleter(Completer):'
1150 return filter(completion_filter, interpreter.completions())
1151 return filter(completion_filter, interpreter.completions())
1151 except Exception as e:
1152 except Exception as e:
1152 if self.debug:
1153 if self.debug:
1153 return [_FakeJediCompletion('Opps Jedi has crash please report a bug with the following:\n"""\n%s\ns"""' % (e))]
1154 return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))]
1154 else:
1155 else:
1155 return []
1156 return []
1156
1157
General Comments 0
You need to be logged in to leave comments. Login now