Skip to content

Commit

Permalink
feat: Add metadata for read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 1, 2024
1 parent 97b7803 commit d3cf9dc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions jcs-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,18 @@ mouse-1: Switch project"
(defun jcs-modeline--render-read-only ()
"Render read-only indicator."
(concat " "
(if buffer-read-only
(or (jcs-modeline--char-displayable-p "πŸ”’")
"&L")
(or (jcs-modeline--char-displayable-p "πŸ”“")
"&U"))))
(propertize (if buffer-read-only
(or (jcs-modeline--char-displayable-p "πŸ”’")
"&L")
(or (jcs-modeline--char-displayable-p "πŸ”“")
"&U"))
'mouse-face 'mode-line-highlight
'help-echo (format "Buffer read-only: %s"
(if buffer-read-only "ON" "OFF"))
'local-map
(let ((map (make-sparse-keymap)))
(define-key map (vector 'mode-line 'mouse-1) #'read-only-mode)
map))))

;;
;;; Text Scale
Expand Down

0 comments on commit d3cf9dc

Please sign in to comment.