Skip to content

Commit

Permalink
auto merge of #11244 : johnwalker/rust/issue-11239, r=brson
Browse files Browse the repository at this point in the history
forward-to-word is undefined, and so Emacs would throw errors in
rust-align-to-expr-after-brace. This change yields the expected
behavior discussed in issue #11239 by handling the case when
whitespace follows a left bracket.
  • Loading branch information
bors committed Jan 1, 2014
2 parents 03b5102 + 8271ba8 commit 7fc4df3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/etc/emacs/rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
;; We don't want to indent out to the open bracket if the
;; open bracket ends the line
(when (not (looking-at "[[:blank:]]*\\(?://.*\\)?$"))
(when (looking-at "[[:space:]]") (forward-to-word 1))
(when (looking-at "[[:space:]]")
(forward-word 1)
(backward-word 1))
(current-column))))

(defun rust-mode-indent-line ()
Expand Down

0 comments on commit 7fc4df3

Please sign in to comment.