##// END OF EJS Templates
Improve handling of cursor_start and cursor_end for completions....
Steven Silvester -
Show More
@@ -151,6 +151,18 b' class IPythonWidget(FrontendWidget):'
151 start = content['cursor_start']
151 start = content['cursor_start']
152 end = content['cursor_end']
152 end = content['cursor_end']
153
153
154 start = max(start, 0)
155 end = max(end, start + 1)
156
157 cursor_pos = self._get_input_buffer_cursor_pos()
158 if end < cursor_pos:
159 cursor.movePosition(QtGui.QTextCursor.Left,
160 n=(cursor_pos - end))
161 elif end > cursor_pos:
162 cursor.movePosition(QtGui.QTextCursor.Right,
163 n=(end - cursor_pos))
164 self._control.setTextCursor(cursor)
165
154 offset = end - start
166 offset = end - start
155 # Move the cursor to the start of the match and complete.
167 # Move the cursor to the start of the match and complete.
156 cursor.movePosition(QtGui.QTextCursor.Left, n=offset)
168 cursor.movePosition(QtGui.QTextCursor.Left, n=offset)
General Comments 0
You need to be logged in to leave comments. Login now