File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -862,8 +862,9 @@ Also handles C++ lambda capture by reference."
862
862
863
863
(defun electric-operator-python-mode-in-lambda-args? ()
864
864
" Are we inside the arguments statement of a lambda?"
865
- ; ; \\ (\\ s-\\ |^\\ ) instead of just \\ b because otherwise foo_lambda matches
866
- (electric-operator-looking-back-locally " \\ (\\ s-\\ |^\\ )lambda\\ s-[^:]*" ))
865
+ ; ; We can't just \\ b because otherwise foo_lambda matches, so we need a whole
866
+ ; ; explicit list of things that could be before a lambda.
867
+ (electric-operator-looking-back-locally " \\ ([(,:[{=\\ s-]\\ |^\\ )lambda\\ s-[^:]*" ))
867
868
868
869
(defun electric-operator-python-mode-: ()
869
870
" Handle python dict assignment"
Original file line number Diff line number Diff line change @@ -176,6 +176,11 @@ Feature: Python mode basics
176
176
When I type "lambda: x, y=1"
177
177
Then I should see "lambda: x, y = 1"
178
178
179
+ Scenario : Space after lambda arguments even inside a function
180
+ When I type "foo(lambda x:x"
181
+ Then I should see "foo(lambda x: x"
182
+
183
+
179
184
# Slice operator
180
185
Scenario : Don't space : inside slices
181
186
When I type "a[1:2]"
You can’t perform that action at this time.
0 commit comments