From a396b216c25563f4e08c12a215bfe8c9ced52c0e Mon Sep 17 00:00:00 2001 From: dx Date: Sun, 31 May 2020 17:23:58 +0100 Subject: +visual-line segment --- Doom/.doom.d/modules/private/oreoline/config.el | 47 +++++++++++++++---------- 1 file changed, 29 insertions(+), 18 deletions(-) (limited to 'Doom/.doom.d/modules') diff --git a/Doom/.doom.d/modules/private/oreoline/config.el b/Doom/.doom.d/modules/private/oreoline/config.el index 7d34709..0bc3a41 100644 --- a/Doom/.doom.d/modules/private/oreoline/config.el +++ b/Doom/.doom.d/modules/private/oreoline/config.el @@ -38,24 +38,35 @@ (propertize "") (propertize ""))) - ;; LHS - (setq telephone-line-lhs - '((evil . (telephone-line-evil-tag-segment - telephone-line-buffer-modified-segment)) - (accent . (telephone-line-vc-segment - telephone-line-filesize-segment - telephone-line-buffer-name-segment - telephone-line-erc-modified-channels-segment - telephone-line-process-segment)) - (nil . ()))) - - ;; RHS - (setq telephone-line-rhs - '((nil . (telephone-line-misc-info-segment)) - (accent . (telephone-line-major-mode-segment - +oreoline-lsp-segment - telephone-line-flycheck-segment)) - (evil . (telephone-line-airline-position-segment)))) + ;; Visual line check + (telephone-line-defsegment +oreoline-visual-segment () + (if mark-active + (let ((lines (count-lines (region-beginning) (region-end))) + (chars (- (region-end) (region-beginning)))) + (if (< lines 2) + (propertize (format "%sC" chars)) + (propertize (format "%sL %sC" lines chars)))) + (propertize "~"))) + + (setq + ;; LHS + telephone-line-lhs + '((evil . (telephone-line-evil-tag-segment + telephone-line-buffer-modified-segment)) + (accent . (telephone-line-filesize-segment + telephone-line-buffer-name-segment + telephone-line-erc-modified-channels-segment + telephone-line-process-segment)) + (nil . ())) + ;; RHS + telephone-line-rhs + '((nil . (telephone-line-misc-info-segment)) + (accent . (telephone-line-vc-segment + +oreoline-lsp-segment + telephone-line-major-mode-segment + telephone-line-flycheck-segment)) + (modal . (+oreoline-visual-segment)) + (evil . (telephone-line-airline-position-segment)))) :config (size-indication-mode +1)) -- cgit v1.2.3-13-gbd6f