about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2013-08-29 23:28:36 -0400
committerMicah Chalmer <micah@micahchalmer.net>2013-08-29 23:28:36 -0400
commit0b9dc80d493cb911a2d9d4152433b5998a40d556 (patch)
tree02cb92398272e1e0062b797068a95d43d3642126 /src
parent20def317685b39a35416397b35940a4d040bf72f (diff)
downloadrust-0b9dc80d493cb911a2d9d4152433b5998a40d556.tar.gz
rust-0b9dc80d493cb911a2d9d4152433b5998a40d556.zip
One indent after open paren with no argument
Diffstat (limited to 'src')
-rw-r--r--src/etc/emacs/rust-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el
index b79d09395b0..8cf6c455979 100644
--- a/src/etc/emacs/rust-mode.el
+++ b/src/etc/emacs/rust-mode.el
@@ -68,7 +68,13 @@
                (let ((pt (point)))
                  (rust-rewind-irrelevant)
                  (backward-up-list)
-                 (if (looking-at "[[(]")
+                 (if (and
+                      (looking-at "[[(]")
+                      ; We don't want to indent out to the open bracket if the
+                      ; open bracket ends the line
+                      (save-excursion 
+                        (forward-char)
+                        (not (looking-at "[[:space:]]*\\(?://.*\\)?$"))))
                      (+ 1 (current-column))
                    (progn
                      (goto-char pt)
@@ -80,7 +86,7 @@
                          (beginning-of-line)
                          (rust-rewind-irrelevant)
                          (end-of-line)
-                         (if (looking-back "[,;{}][[:space:]]*\\(?://.*\\)?")
+                         (if (looking-back "[,;{}(][[:space:]]*\\(?://.*\\)?")
                              (* rust-indent-offset level)
                            (back-to-indentation)
                            (if (looking-at "#")