diff options
| author | Micah Chalmer <micah@micahchalmer.net> | 2013-08-29 23:28:36 -0400 |
|---|---|---|
| committer | Micah Chalmer <micah@micahchalmer.net> | 2013-08-29 23:28:36 -0400 |
| commit | 12480f9557fa9d1bcf5d63629a06bd7090d1f601 (patch) | |
| tree | 3a5a7cdc5a2e8cb13096c4a413978b4c0e5fcf92 | |
| parent | 1962971cb2f2399528ba82897f210fdf3acf3c5e (diff) | |
| download | rust-mode-12480f9557fa9d1bcf5d63629a06bd7090d1f601.tar.gz | |
One indent after open paren with no argument
| -rw-r--r-- | rust-mode.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el index b79d093..8cf6c45 100644 --- a/rust-mode.el +++ b/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 "#") |
