emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode 88ff62a 182/486: Remove unnecessary code with ca


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 88ff62a 182/486: Remove unnecessary code with call to undefined function
Date: Sat, 7 Aug 2021 09:25:14 -0400 (EDT)

branch: elpa/rust-mode
commit 88ff62ad3181d9976c9f435efa614b422037af51
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>

    Remove unnecessary code with call to undefined function
---
 rust-mode-tests.el | 29 +++++++++++++++++++++++++++++
 rust-mode.el       |  8 --------
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 4a6cf20..5312f38 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -2168,6 +2168,35 @@ type Foo<T> where T: Copy = Box<T>;
      '((10 11))
      '(7 9))))
 
+
+(ert-deftest font-lock-extend-region-in-string ()
+  
+  (with-temp-buffer
+    (rust-mode)
+    (insert "
+fn foo() {
+    let x = r\"
+Fontification needs to include this whole string or none of it.
+             \"
+}")
+    (font-lock-fontify-buffer)
+    (let ((font-lock-beg 13)
+          (font-lock-end 42))
+      (rust-font-lock-extend-region)
+      (should (<= font-lock-beg 13))
+      (should (>= font-lock-end 106))
+      )
+    (let ((font-lock-beg 42)
+          (font-lock-end 108))
+      (rust-font-lock-extend-region)
+      (should (<= font-lock-beg 25))
+      (should (>= font-lock-end 108)))
+    (let ((font-lock-beg 1)
+          (font-lock-end 12))
+      (rust-font-lock-extend-region)
+      (should (<= font-lock-beg 1))
+      (should (>= font-lock-end 12)))))
+
 ;; If electric-pair-mode is available, load it and run the tests that use it.  
If not,
 ;; no error--the tests will be skipped.
 (require 'elec-pair nil t)
diff --git a/rust-mode.el b/rust-mode.el
index 3d1ba02..40a2492 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -459,14 +459,6 @@
             (goto-char (nth 8 end-ppss))
             (ignore-errors (forward-sexp))
             (setq font-lock-end (max font-lock-end (point)))))
-        
-        ;; If we have the beginning of a raw string in the region, make sure 
we have the end of
-        ;; it.
-        (when (or beg-in-str end-in-str)
-          (save-excursion
-            (goto-char font-lock-beg)
-            (while (and (< (point) font-lock-end) (ignore-errors 
(rust-look-for-raw-string (buffer-end 1)))))
-            (setq font-lock-end (max font-lock-end (point)))))
         )))
 
     (or (/= font-lock-beg orig-beg)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]