##// END OF EJS Templates
Merge pull request #6692 from blink1073/qtconsole-completion...
Thomas Kluyver -
r18365:3f95fb30 merge
parent child Browse files
Show More
@@ -151,8 +151,23 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 # Move the control's cursor to the desired end point
158 cursor_pos = self._get_input_buffer_cursor_pos()
159 if end < cursor_pos:
160 cursor.movePosition(QtGui.QTextCursor.Left,
161 n=(cursor_pos - end))
162 elif end > cursor_pos:
163 cursor.movePosition(QtGui.QTextCursor.Right,
164 n=(end - cursor_pos))
165 # This line actually applies the move to control's cursor
166 self._control.setTextCursor(cursor)
167
154 offset = end - start
168 offset = end - start
155 # Move the cursor to the start of the match and complete.
169 # Move the local cursor object to the start of the match and
170 # complete.
156 cursor.movePosition(QtGui.QTextCursor.Left, n=offset)
171 cursor.movePosition(QtGui.QTextCursor.Left, n=offset)
157 self._complete_with_items(cursor, matches)
172 self._complete_with_items(cursor, matches)
158
173
General Comments 0
You need to be logged in to leave comments. Login now