Show More
@@ -5,6 +5,7 b' _build' | |||
|
5 | 5 | docs/man/*.gz |
|
6 | 6 | docs/source/api/generated |
|
7 | 7 | docs/source/config/options |
|
8 | docs/source/config/shortcuts/*.csv | |
|
8 | 9 | docs/source/interactive/magics-generated.txt |
|
9 | 10 | docs/gh-pages |
|
10 | 11 | jupyter_notebook/notebook/static/mathjax |
@@ -47,6 +47,9 b" if sys.platform == 'win32':" | |||
|
47 | 47 | else: |
|
48 | 48 | PROTECTABLES = ' ()[]{}?=\\|;:\'#*"^&' |
|
49 | 49 | |
|
50 | # Protect against returning an enormous number of completions which the frontend | |
|
51 | # may have trouble processing. | |
|
52 | MATCHES_LIMIT = 500 | |
|
50 | 53 | |
|
51 | 54 | def has_open_quotes(s): |
|
52 | 55 | """Return whether a string has open quotes. |
@@ -1142,7 +1145,7 b' class IPCompleter(Completer):' | |||
|
1142 | 1145 | for meth in (self.unicode_name_matches, back_latex_name_matches, back_unicode_name_matches): |
|
1143 | 1146 | name_text, name_matches = meth(base_text) |
|
1144 | 1147 | if name_text: |
|
1145 | return name_text, name_matches | |
|
1148 | return name_text, name_matches[:MATCHES_LIMIT] | |
|
1146 | 1149 | |
|
1147 | 1150 | # if text is either None or an empty string, rely on the line buffer |
|
1148 | 1151 | if not text: |
@@ -1183,6 +1186,6 b' class IPCompleter(Completer):' | |||
|
1183 | 1186 | # different types of objects. The rlcomplete() method could then |
|
1184 | 1187 | # simply collapse the dict into a list for readline, but we'd have |
|
1185 | 1188 | # richer completion semantics in other evironments. |
|
1186 | self.matches = sorted(set(self.matches), key=completions_sorting_key) | |
|
1189 | self.matches = sorted(set(self.matches), key=completions_sorting_key)[:MATCHES_LIMIT] | |
|
1187 | 1190 | |
|
1188 | 1191 | return text, self.matches |
General Comments 0
You need to be logged in to leave comments.
Login now