##// END OF EJS Templates
Add missing auto_match flag in shortcuts.py...
Gal B -
Show More
@@ -150,7 +150,9 b' def create_ipython_shortcuts(shell):'
150 event.current_buffer.cursor_left()
150 event.current_buffer.cursor_left()
151
151
152 # raw string
152 # raw string
153 @kb.add("(", filter=focused_insert & preceding_text(r".*(r|R)[\"'](-*)$"))
153 @kb.add(
154 "(", filter=focused_insert & auto_match & preceding_text(r".*(r|R)[\"'](-*)$")
155 )
154 def _(event):
156 def _(event):
155 matches = re.match(
157 matches = re.match(
156 r".*(r|R)[\"'](-*)",
158 r".*(r|R)[\"'](-*)",
@@ -160,7 +162,9 b' def create_ipython_shortcuts(shell):'
160 event.current_buffer.insert_text("()" + dashes)
162 event.current_buffer.insert_text("()" + dashes)
161 event.current_buffer.cursor_left(len(dashes) + 1)
163 event.current_buffer.cursor_left(len(dashes) + 1)
162
164
163 @kb.add("[", filter=focused_insert & preceding_text(r".*(r|R)[\"'](-*)$"))
165 @kb.add(
166 "[", filter=focused_insert & auto_match & preceding_text(r".*(r|R)[\"'](-*)$")
167 )
164 def _(event):
168 def _(event):
165 matches = re.match(
169 matches = re.match(
166 r".*(r|R)[\"'](-*)",
170 r".*(r|R)[\"'](-*)",
@@ -170,7 +174,9 b' def create_ipython_shortcuts(shell):'
170 event.current_buffer.insert_text("[]" + dashes)
174 event.current_buffer.insert_text("[]" + dashes)
171 event.current_buffer.cursor_left(len(dashes) + 1)
175 event.current_buffer.cursor_left(len(dashes) + 1)
172
176
173 @kb.add("{", filter=focused_insert & preceding_text(r".*(r|R)[\"'](-*)$"))
177 @kb.add(
178 "{", filter=focused_insert & auto_match & preceding_text(r".*(r|R)[\"'](-*)$")
179 )
174 def _(event):
180 def _(event):
175 matches = re.match(
181 matches = re.match(
176 r".*(r|R)[\"'](-*)",
182 r".*(r|R)[\"'](-*)",
@@ -180,12 +186,12 b' def create_ipython_shortcuts(shell):'
180 event.current_buffer.insert_text("{}" + dashes)
186 event.current_buffer.insert_text("{}" + dashes)
181 event.current_buffer.cursor_left(len(dashes) + 1)
187 event.current_buffer.cursor_left(len(dashes) + 1)
182
188
183 @kb.add('"', filter=focused_insert & preceding_text(r".*(r|R)$"))
189 @kb.add('"', filter=focused_insert & auto_match & preceding_text(r".*(r|R)$"))
184 def _(event):
190 def _(event):
185 event.current_buffer.insert_text('""')
191 event.current_buffer.insert_text('""')
186 event.current_buffer.cursor_left()
192 event.current_buffer.cursor_left()
187
193
188 @kb.add("'", filter=focused_insert & preceding_text(r".*(r|R)$"))
194 @kb.add("'", filter=focused_insert & auto_match & preceding_text(r".*(r|R)$"))
189 def _(event):
195 def _(event):
190 event.current_buffer.insert_text("''")
196 event.current_buffer.insert_text("''")
191 event.current_buffer.cursor_left()
197 event.current_buffer.cursor_left()
General Comments 0
You need to be logged in to leave comments. Login now