Show More
@@ -154,6 +154,7 b' class IPythonWidget(FrontendWidget):' | |||||
154 | start = max(start, 0) |
|
154 | start = max(start, 0) | |
155 | end = max(end, start + 1) |
|
155 | end = max(end, start + 1) | |
156 |
|
156 | |||
|
157 | # Move the control's cursor to the desired end point | |||
157 | cursor_pos = self._get_input_buffer_cursor_pos() |
|
158 | cursor_pos = self._get_input_buffer_cursor_pos() | |
158 | if end < cursor_pos: |
|
159 | if end < cursor_pos: | |
159 | cursor.movePosition(QtGui.QTextCursor.Left, |
|
160 | cursor.movePosition(QtGui.QTextCursor.Left, | |
@@ -161,10 +162,12 b' class IPythonWidget(FrontendWidget):' | |||||
161 | elif end > cursor_pos: |
|
162 | elif end > cursor_pos: | |
162 | cursor.movePosition(QtGui.QTextCursor.Right, |
|
163 | cursor.movePosition(QtGui.QTextCursor.Right, | |
163 | n=(end - cursor_pos)) |
|
164 | n=(end - cursor_pos)) | |
|
165 | # This line actually applies the move to control's cursor | |||
164 | self._control.setTextCursor(cursor) |
|
166 | self._control.setTextCursor(cursor) | |
165 |
|
167 | |||
166 | offset = end - start |
|
168 | offset = end - start | |
167 |
# Move the cursor to the start of the match and |
|
169 | # Move the local cursor object to the start of the match and | |
|
170 | # complete. | |||
168 | cursor.movePosition(QtGui.QTextCursor.Left, n=offset) |
|
171 | cursor.movePosition(QtGui.QTextCursor.Left, n=offset) | |
169 | self._complete_with_items(cursor, matches) |
|
172 | self._complete_with_items(cursor, matches) | |
170 |
|
173 |
General Comments 0
You need to be logged in to leave comments.
Login now