summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/prog/jao-rust.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/prog/jao-rust.el b/lib/prog/jao-rust.el
index ddb3307..1b2f736 100644
--- a/lib/prog/jao-rust.el
+++ b/lib/prog/jao-rust.el
@@ -49,11 +49,16 @@
(replace-regexp-in-string "\\(^\\|/\\)\\(mod\\|lib\\|main\\)$" "")
(string-replace "/" "::")))))
+(defun jao-rust-crate-name ()
+ (file-name-nondirectory
+ (replace-regexp-in-string "/$" "" (or (jao-rust--root) ""))))
+
;;;###autoload
(define-minor-mode jao-rust-show-module-mode
"Show the current file's module in the mode line lighter"
- :lighter (:eval (if-let* ((m (jao-rust-current-module-name)))
- (format " ::%s" m))))
+ :lighter (:eval (if-let* ((m (jao-rust-current-module-name))
+ (c (jao-rust-crate-name)))
+ (format " %s::%s" c m))))
(defun jao-rust--tests-prefix ()
(let ((m (jao-rust-current-module-name)))