Show More
@@ -113,7 +113,7 b' def create_ipython_shortcuts(shell):' | |||||
113 | c = buf[i] |
|
113 | c = buf[i] | |
114 | if c == quote: |
|
114 | if c == quote: | |
115 | paired = not paired |
|
115 | paired = not paired | |
116 |
elif c == |
|
116 | elif c == "\\": | |
117 | i += 1 |
|
117 | i += 1 | |
118 | i += 1 |
|
118 | i += 1 | |
119 | return paired |
|
119 | return paired | |
@@ -127,16 +127,19 b' def create_ipython_shortcuts(shell):' | |||||
127 | return _preceding_text_cache[pattern] |
|
127 | return _preceding_text_cache[pattern] | |
128 |
|
128 | |||
129 | if callable(pattern): |
|
129 | if callable(pattern): | |
|
130 | ||||
130 | def _preceding_text(): |
|
131 | def _preceding_text(): | |
131 | app = get_app() |
|
132 | app = get_app() | |
132 | before_cursor = app.current_buffer.document.current_line_before_cursor |
|
133 | before_cursor = app.current_buffer.document.current_line_before_cursor | |
133 | return bool(pattern(before_cursor)) |
|
134 | return bool(pattern(before_cursor)) | |
|
135 | ||||
134 | else: |
|
136 | else: | |
135 | m = re.compile(pattern) |
|
137 | m = re.compile(pattern) | |
136 |
|
138 | |||
137 | def _preceding_text(): |
|
139 | def _preceding_text(): | |
138 | app = get_app() |
|
140 | app = get_app() | |
139 |
|
|
141 | before_cursor = app.current_buffer.document.current_line_before_cursor | |
|
142 | return bool(m.match(before_cursor)) | |||
140 |
|
143 | |||
141 | condition = Condition(_preceding_text) |
|
144 | condition = Condition(_preceding_text) | |
142 | _preceding_text_cache[pattern] = condition |
|
145 | _preceding_text_cache[pattern] = condition |
General Comments 0
You need to be logged in to leave comments.
Login now