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 aligning of method chains (more-or-less), add various unit tests, and add matching angle brackets. #22

Merged
merged 2 commits into from
Feb 6, 2015

Conversation

nikomatsakis
Copy link
Contributor

  • Fixes indentation for method chains (which I suspect we should default to "on").
  • Causes matching < to be briefly highlighted when > is typed (configurable to "off", defaults to "on").

Caveat for method chains: The regular expressions are probably kind of wrong for things like

self.foo.something::<X>()
        .more();

Fixes #13.
Fixes #23.

The regular expressions are probably kind of wrong for things like

    self.foo.something::<X>()
            .more();
@rust-highfive
Copy link

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

…typed.

Also add an interactive command for finding the matching `<`. I'd like to bind
this to `C-c >` (reserved for major modes), but I can't figure out what the local
keymap is for rust-mode (help!).
@nikomatsakis nikomatsakis changed the title Fix aligning of method chains (more-or-less) and add various unit tests. Fix aligning of method chains (more-or-less), add various unit tests, and add matching angle brackets. Feb 6, 2015
@pnkfelix
Copy link
Member

pnkfelix commented Feb 6, 2015

Sweet!

(The angle-bracket matching is not quite smart enough to e.g. skip over the content of comments or string literals. But I do not see that as a reason to reject it.)

pnkfelix added a commit that referenced this pull request Feb 6, 2015
Fix aligning of method chains (more-or-less), add various unit tests, and add matching angle brackets.
@pnkfelix pnkfelix merged commit ec81a95 into rust-lang:master Feb 6, 2015
@nikomatsakis
Copy link
Contributor Author

@pnkfelix yes, good point, it also doesn't detect mismatched kinds of parens, which would be useful. But the presence of comments or string literals within types seems pretty unlikely in any case.

@nikomatsakis
Copy link
Contributor Author

(in any case a mismatch is fairly harmless)

pnkfelix added a commit to pnkfelix/rust-mode that referenced this pull request Feb 6, 2015
… `>` is typed."

This reverts commit 55e7483.

Undoing PR rust-lang#22 since it broke emacs23 support.
This was referenced Feb 6, 2015
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.

Highlight matching angle brackets Emacs: rust-indent-method-chains indents beginning of line oddly
3 participants