From 6b57bbf52530acdfdd9cc4b6c2ec198d0ac57e22 Mon Sep 17 00:00:00 2001 From: Micah Chalmer Date: Fri, 6 Feb 2015 22:16:33 -0500 Subject: Make features (and their tests) work on emacs 23 --- rust-mode-tests.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index a0e27b0..347dcd2 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -289,7 +289,11 @@ very very very long string (rust-test-manip-code deindented 1 - (lambda () (indent-region 1 (buffer-size))) + (lambda () + ;; The indentation will fial in some cases if the syntax properties are + ;; not set. This only happens when font-lock fontifies the buffer. + (font-lock-fontify-buffer) + (indent-region 1 (buffer-size))) indented))) -- cgit v1.2.3 From 2038365705131ce73c4511e886f2896fa83b01c4 Mon Sep 17 00:00:00 2001 From: Micah Chalmer Date: Fri, 6 Feb 2015 22:26:56 -0500 Subject: Fix bug in rust-indent-method-chains --- rust-mode-tests.el | 9 +++++++++ rust-mode.el | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'rust-mode-tests.el') 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))))) -- cgit v1.2.3