Skip to content

Commit 0b9dc80

Browse files
committed
One indent after open paren with no argument
1 parent 20def31 commit 0b9dc80

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/etc/emacs/rust-mode.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@
6868
(let ((pt (point)))
6969
(rust-rewind-irrelevant)
7070
(backward-up-list)
71-
(if (looking-at "[[(]")
71+
(if (and
72+
(looking-at "[[(]")
73+
; We don't want to indent out to the open bracket if the
74+
; open bracket ends the line
75+
(save-excursion
76+
(forward-char)
77+
(not (looking-at "[[:space:]]*\\(?://.*\\)?$"))))
7278
(+ 1 (current-column))
7379
(progn
7480
(goto-char pt)
@@ -80,7 +86,7 @@
8086
(beginning-of-line)
8187
(rust-rewind-irrelevant)
8288
(end-of-line)
83-
(if (looking-back "[,;{}][[:space:]]*\\(?://.*\\)?")
89+
(if (looking-back "[,;{}(][[:space:]]*\\(?://.*\\)?")
8490
(* rust-indent-offset level)
8591
(back-to-indentation)
8692
(if (looking-at "#")

0 commit comments

Comments
 (0)