diff options
| author | Micah Chalmer <micah@micahchalmer.net> | 2015-02-06 22:26:56 -0500 |
|---|---|---|
| committer | Micah Chalmer <micah@micahchalmer.net> | 2015-02-06 22:39:06 -0500 |
| commit | 2038365705131ce73c4511e886f2896fa83b01c4 (patch) | |
| tree | afe6a39707abab13a82a859e397649cad1d29eea | |
| parent | f3e8f2029e02d635eb49ee03d03ff4c67516a1d8 (diff) | |
| download | rust-mode-2038365705131ce73c4511e886f2896fa83b01c4.tar.gz | |
Fix bug in rust-indent-method-chains
| -rw-r--r-- | rust-mode-tests.el | 9 | ||||
| -rw-r--r-- | rust-mode.el | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 347dcd2..36e59df 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1012,3 +1012,12 @@ fn main() { } " ))) + +(ert-deftest indent-method-chains-after-comment () + (let ((rust-indent-method-chain t)) (test-indent + " +fn main() { // comment here should not push next line out + foo.bar() +} +" + ))) diff --git a/rust-mode.el b/rust-mode.el index 3413592..43afd9a 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -131,7 +131,7 @@ ;; ((skip-dot-identifier (lambda () - (when (looking-back (concat "\." rust-re-ident)) + (when (looking-back (concat "\\." rust-re-ident)) (backward-word 1) (backward-char) (- (current-column) rust-indent-offset))))) |
