Show More
@@ -31,7 +31,7 b' class CompletionLexer(object):' | |||||
31 | not string.endswith('\n'): |
|
31 | not string.endswith('\n'): | |
32 | reversed_tokens.pop(0) |
|
32 | reversed_tokens.pop(0) | |
33 |
|
33 | |||
34 |
current_op = |
|
34 | current_op = '' | |
35 | for token, text in reversed_tokens: |
|
35 | for token, text in reversed_tokens: | |
36 |
|
36 | |||
37 | if is_token_subtype(token, Token.Name): |
|
37 | if is_token_subtype(token, Token.Name): | |
@@ -39,14 +39,14 b' class CompletionLexer(object):' | |||||
39 | # Handle a trailing separator, e.g 'foo.bar.' |
|
39 | # Handle a trailing separator, e.g 'foo.bar.' | |
40 | if current_op in self._name_separators: |
|
40 | if current_op in self._name_separators: | |
41 | if not context: |
|
41 | if not context: | |
42 |
context.insert(0, |
|
42 | context.insert(0, '') | |
43 |
|
43 | |||
44 | # Handle non-separator operators and punction. |
|
44 | # Handle non-separator operators and punction. | |
45 | elif current_op: |
|
45 | elif current_op: | |
46 | break |
|
46 | break | |
47 |
|
47 | |||
48 | context.insert(0, text) |
|
48 | context.insert(0, text) | |
49 |
current_op = |
|
49 | current_op = '' | |
50 |
|
50 | |||
51 | # Pygments doesn't understand that, e.g., '->' is a single operator |
|
51 | # Pygments doesn't understand that, e.g., '->' is a single operator | |
52 | # in C++. This is why we have to build up an operator from |
|
52 | # in C++. This is why we have to build up an operator from |
@@ -112,7 +112,7 b' class CompletionWidget(QtGui.QListWidget):' | |||||
112 | def _update_current(self): |
|
112 | def _update_current(self): | |
113 | """ Updates the current item based on the current text. |
|
113 | """ Updates the current item based on the current text. | |
114 | """ |
|
114 | """ | |
115 |
prefix = self._current_text_cursor().select |
|
115 | prefix = self._current_text_cursor().selection().toPlainText() | |
116 | if prefix: |
|
116 | if prefix: | |
117 | items = self.findItems(prefix, (QtCore.Qt.MatchStartsWith | |
|
117 | items = self.findItems(prefix, (QtCore.Qt.MatchStartsWith | | |
118 | QtCore.Qt.MatchCaseSensitive)) |
|
118 | QtCore.Qt.MatchCaseSensitive)) |
@@ -274,7 +274,7 b' class FrontendWidget(HistoryConsoleWidget):' | |||||
274 | cursor = self.textCursor() |
|
274 | cursor = self.textCursor() | |
275 | cursor.movePosition(QtGui.QTextCursor.StartOfLine, |
|
275 | cursor.movePosition(QtGui.QTextCursor.StartOfLine, | |
276 | QtGui.QTextCursor.KeepAnchor) |
|
276 | QtGui.QTextCursor.KeepAnchor) | |
277 |
text = |
|
277 | text = str(cursor.selection().toPlainText()) | |
278 | return self._completion_lexer.get_context(text) |
|
278 | return self._completion_lexer.get_context(text) | |
279 |
|
279 | |||
280 | def _interrupt_kernel(self): |
|
280 | def _interrupt_kernel(self): |
General Comments 0
You need to be logged in to leave comments.
Login now