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

julia-mode.el: Set a maximum lookback for finding enclosing parens/blocks #9308

Merged
merged 2 commits into from
Dec 11, 2014

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Dec 11, 2014

Fixes #9254.

After further thought, I didn't like my proposed solution of just considering the previous line for indenting. The current approach is much smarter and more desirable -- we try to work out how many enclosing blocks we're in.

I've compromised by setting a maximum lookback for finding enclosing parens (this was the most expensive part) and for finding enclosing blocks (this is cheaper, but still affects performance, so I've set a higher value).

I've also added a few unit tests for indentation.

Let me know what you think, I think this is a big improvement. Sorry it took so long.

cc @JeffBezanson

@JeffBezanson
Copy link
Member

Excellent! Love the tests.

I might fiddle with it and set the numbers a bit higher; you can hit those limits e.g. in big dict and array literals.

JeffBezanson added a commit that referenced this pull request Dec 11, 2014
julia-mode.el: Set a maximum lookback for finding enclosing parens/blocks
@JeffBezanson JeffBezanson merged commit 98b9f8c into JuliaLang:master Dec 11, 2014
@Wilfred Wilfred deleted the wh/julia_mode_lookback_limit branch February 17, 2015 13:15
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.

julia-mode.el: hitting return at top level is very slow
2 participants