##// 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 150 event.current_buffer.cursor_left()
151 151
152 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 156 def _(event):
155 157 matches = re.match(
156 158 r".*(r|R)[\"'](-*)",
@@ -160,7 +162,9 b' def create_ipython_shortcuts(shell):'
160 162 event.current_buffer.insert_text("()" + dashes)
161 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 168 def _(event):
165 169 matches = re.match(
166 170 r".*(r|R)[\"'](-*)",
@@ -170,7 +174,9 b' def create_ipython_shortcuts(shell):'
170 174 event.current_buffer.insert_text("[]" + dashes)
171 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 180 def _(event):
175 181 matches = re.match(
176 182 r".*(r|R)[\"'](-*)",
@@ -180,12 +186,12 b' def create_ipython_shortcuts(shell):'
180 186 event.current_buffer.insert_text("{}" + dashes)
181 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 190 def _(event):
185 191 event.current_buffer.insert_text('""')
186 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 195 def _(event):
190 196 event.current_buffer.insert_text("''")
191 197 event.current_buffer.cursor_left()
General Comments 0
You need to be logged in to leave comments. Login now