Skip to content

Commit

Permalink
rust-mode.el: use tab-width instead of default-tab-width
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Aug 10, 2013
1 parent f0fc9c9 commit b6848f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/etc/emacs/rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
(let ((level (rust-paren-level)))
(cond
;; A function return type is 1 level indented
((looking-at "->") (* default-tab-width (+ level 1)))
((looking-at "->") (* tab-width (+ level 1)))

;; A closing brace is 1 level unindended
((looking-at "}") (* default-tab-width (- level 1)))
((looking-at "}") (* tab-width (- level 1)))

;; If we're in any other token-tree / sexp, then:
;; - [ or ( means line up with the opening token
Expand All @@ -70,18 +70,18 @@
(goto-char pt)
(back-to-indentation)
(if (looking-at "\\<else\\>")
(* default-tab-width (+ 1 level))
(* tab-width (+ 1 level))
(progn
(goto-char pt)
(beginning-of-line)
(rust-rewind-irrelevant)
(end-of-line)
(if (looking-back "[{};,]")
(* default-tab-width level)
(* tab-width level)
(back-to-indentation)
(if (looking-at "#")
(* default-tab-width level)
(* default-tab-width (+ 1 level))))))))))
(* tab-width level)
(* tab-width (+ 1 level))))))))))

;; Otherwise we're in a column-zero definition
(t 0))))))
Expand Down

0 comments on commit b6848f5

Please sign in to comment.