Skip to content

Commit c8d4905

Browse files
committed
Add defcustom to show point
1 parent 1f0840d commit c8d4905

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

jcs-modeline.el

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@
140140
;; (@* "Util" )
141141
;;
142142

143+
(defun jcs-modeline-2str (obj)
144+
"Convert OBJ to string."
145+
(format "%s" obj))
146+
143147
;; TODO: Use function `string-pixel-width' after 29.1
144148
(defun jcs-modeline--string-pixel-width (str)
145149
"Return the width of STR in pixels."
@@ -258,9 +262,17 @@
258262
;;
259263
;;; Line and Columns
260264

265+
(defcustom jcs-modeline-show-point nil
266+
"If non-nil, also shows point information."
267+
:type 'boolean
268+
:group 'jcs-modeline)
269+
261270
(defun jcs-modeline--render-line-columns ()
262271
"Render current line number and column."
263-
(moody-tab "%l : %c" 0 'up))
272+
(moody-tab (if jcs-modeline-show-point
273+
(concat "%l %c" (format " (%s)" (point)))
274+
"%l : %c")
275+
0 'up))
264276

265277
;;
266278
;;; Project

0 commit comments

Comments
 (0)