Show More
@@ -527,6 +527,12 b' class Completer(Configurable):' | |||||
527 | 'information for experimental jedi integration.')\ |
|
527 | 'information for experimental jedi integration.')\ | |
528 | .tag(config=True) |
|
528 | .tag(config=True) | |
529 |
|
529 | |||
|
530 | backslash_combining_completions = Bool(default=True, | |||
|
531 | help="Control whether or not `\\thins<tab>` will attempt to rewrite using unicode" | |||
|
532 | "that include completion of latex commands, unicode, or re-expand " | |||
|
533 | "unicode to their ascii form").tag(config=True) | |||
|
534 | ||||
|
535 | ||||
530 |
|
536 | |||
531 | def __init__(self, namespace=None, global_namespace=None, **kwargs): |
|
537 | def __init__(self, namespace=None, global_namespace=None, **kwargs): | |
532 | """Create a new completer for the command line. |
|
538 | """Create a new completer for the command line. | |
@@ -1742,16 +1748,18 b' class IPCompleter(Completer):' | |||||
1742 | if not text: |
|
1748 | if not text: | |
1743 | text = self.splitter.split_line(line_buffer, cursor_pos) |
|
1749 | text = self.splitter.split_line(line_buffer, cursor_pos) | |
1744 |
|
1750 | |||
1745 | base_text = text if not line_buffer else line_buffer[:cursor_pos] |
|
1751 | if self.backslash_combining_completions: | |
1746 | latex_text, latex_matches = self.latex_matches(base_text) |
|
1752 | # allow deactivation of these on windows. | |
1747 | if latex_matches: |
|
1753 | base_text = text if not line_buffer else line_buffer[:cursor_pos] | |
1748 |
|
|
1754 | latex_text, latex_matches = self.latex_matches(base_text) | |
1749 | name_text = '' |
|
1755 | if latex_matches: | |
1750 | name_matches = [] |
|
1756 | return latex_text, latex_matches, ['latex_matches']*len(latex_matches), () | |
1751 | for meth in (self.unicode_name_matches, back_latex_name_matches, back_unicode_name_matches): |
|
1757 | name_text = '' | |
1752 |
|
|
1758 | name_matches = [] | |
1753 | if name_text: |
|
1759 | for meth in (self.unicode_name_matches, back_latex_name_matches, back_unicode_name_matches): | |
1754 |
|
|
1760 | name_text, name_matches = meth(base_text) | |
|
1761 | if name_text: | |||
|
1762 | return name_text, name_matches, [meth.__qualname__]*len(name_matches), {} | |||
1755 |
|
1763 | |||
1756 |
|
1764 | |||
1757 | # If no line buffer is given, assume the input text is all there was |
|
1765 | # If no line buffer is given, assume the input text is all there was |
@@ -2,6 +2,13 b'' | |||||
2 | 5.x Series |
|
2 | 5.x Series | |
3 | ============ |
|
3 | ============ | |
4 |
|
4 | |||
|
5 | IPython 5.4 | |||
|
6 | =========== | |||
|
7 | ||||
|
8 | * added ``Completer.backslash_combining_completions`` boolean option to | |||
|
9 | deactivate backslash-tab completion that may conflict with windows path. | |||
|
10 | ||||
|
11 | ||||
5 | IPython 5.3 |
|
12 | IPython 5.3 | |
6 | =========== |
|
13 | =========== | |
7 |
|
14 |
General Comments 0
You need to be logged in to leave comments.
Login now