Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoindentation after data structures. #3576

Merged

Conversation

rlaverde
Copy link
Member

@rlaverde rlaverde commented Oct 21, 2016

Fixes #1373

When a structure is defined in the same line, the autoindent was failing

Indentation was reseting after structures defined in one line
@goanpeca goanpeca added this to the v3.1 milestone Oct 21, 2016
@ccordoba12
Copy link
Member

@rlaverde, could you provide an example of the old and new behaviors?

@goanpeca
Copy link
Member

@rlaverde could we add a test for this behavior?

@rlaverde
Copy link
Member Author

rlaverde commented Oct 21, 2016

@ccordoba12 After writing an opening and closing brackets (declaring list, dicts, or sets ...) the autoindent was wrong

Old behavior: (The | is the cursor)

def somefunc(arg1,
             arg2=0,
             arg3=[1], <enter>

result:

def somefunc(arg1,
             arg2=0,
             arg3=[1],
|

Now:

def somefunc(arg1,
             arg2=0,
             arg3=[1], <enter>

result:

def somefunc(arg1,
             arg2=0,
             arg3=[1],
             |

@rlaverde
Copy link
Member Author

@goanpeca There is already a test for this marked as xfail, now It's passing, should I remove the decorator @pytest.mark.xfail?

https://github.com/spyder-ide/spyder/blob/master/spyder/widgets/sourcecode/tests/test_autoindent.py#L73

@goanpeca
Copy link
Member

@rlaverde yes :-), @jitseniesen I think you were working on those tests right?

@jitseniesen
Copy link
Member

@jitseniesen I think you were working on those tests right?

No, @Nodd was working on auto indentation.

@ccordoba12 ccordoba12 modified the milestones: v3.0.2, v3.1 Oct 22, 2016
@ccordoba12
Copy link
Member

Since tests are passing, I just have to merge :-)

Great work @rlaverde!

@ccordoba12 ccordoba12 changed the title Fix autoindentation after data strutures. Fix autoindentation after data structures. Oct 22, 2016
@ccordoba12 ccordoba12 merged commit c5434b4 into spyder-ide:3.x Oct 22, 2016
ccordoba12 added a commit that referenced this pull request Oct 22, 2016
@rlaverde rlaverde deleted the fix-autoindentation-after-data-structures branch October 22, 2016 17:36
@jitseniesen
Copy link
Member

@rlaverde Has this also fixed #3214?

@rlaverde
Copy link
Member Author

rlaverde commented Oct 24, 2016

@jitseniesen Yes, #1373 is like an specific case of #3214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants