Repository navigation
Indentation updates - #204
Conversation
This is the technically correct regex to prevent dedenting the current line on things like in-line else expressions, but unfortunately the regex is already matched before anything can be done about it :( Leaving it in as is in the hopes that it will be useful someday.
| expect(decreaseIndentRegex.testSync(' elif this_var == that_var')).toBeFalsy() | ||
| expect(decreaseIndentRegex.testSync('else')).toBeFalsy() | ||
| expect(decreaseIndentRegex.testSync(' "finally:"')).toBeFalsy() | ||
|
|
|
Nice! Regexes look good and 💯 on that spec file. |
|
Thanks for reviewing @50Wliu. Let me know what else I can do. |
|
It is a very bad feature for me!!!! There must be some people like me want to turn off this feature. How do I do to turn off this feature? |
|
when I try to write: the |
|
Sorry to hear it doesn't work for you, but I think calling it "a very bad feature" is a bit of a stretch. I've been using it for the past few months and while it is by no means perfect, it has definitely had a net positive effect on the amount of typing I have to do to get correct indentations in Atom. (I could just as easily construct an example that did not correctly dedent before, but now does correctly dedent, and say that the old behavior was "a bad behavior". Trying to parse a complete language with regexes will always have trade-offs.) Still, if it doesn't work for you then it should be fairly straightforward to submit a PR which makes it an option in 'decreaseNextIndentPattern': '^\\s*(pass|return|yield|continue|break|raise)\\b.*$'from the effected file then you should stop seeing the behavior. |
|
@kbrose Thanks for your advice, unfortunately I can't find which file I should modify. Could you tell me more about it? |
the auto '=' in params when coding n you type 'tab' it comes out the list tochoice like this: v n, the tab doesn't work. type ':' the else will auto move to the head. |
|
I found it too and I don't think it is a very good feature
…On 2017年10月9日周一 19:53 zDoNZaI ***@***.***> wrote:
def f(n,lookup):
if n==0 or n==1:
lookup[n]=n
if lookup[n] is None:
lookup[n]=f(n-1,lookup=)+f(n-2,lookup=)
return lookup[n]
the auto '=' in params
def x(n):
if n==1:
return n
when coding n you type 'tab' it comes out the list tochoice like this: v
n, the tab doesn't work.
def x(n):
if n==1:
return n
else:
type ':' the else will auto move to the head.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#204 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJoPKQHn1DlQulne1HJeMSaDRCyya2wZks5sqgkfgaJpZM4OQer_>
.
|
Description of the Change
pass|return|yield|continue|break|raise)Alternate Designs
None.
Benefits
Better support for the Python language.
Possible Drawbacks
return|yield|continue|break|raise?Applicable Issues