From 4d2d3953b806388c4a916803e56165d4dfc24ecd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 25 Apr 2018 05:17:56 -0400 Subject: [PATCH] ui/doom-modeline: fix off-by-one in selection-info segment --- modules/ui/doom-modeline/config.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ui/doom-modeline/config.el b/modules/ui/doom-modeline/config.el index 53659afe6..bc22266f0 100644 --- a/modules/ui/doom-modeline/config.el +++ b/modules/ui/doom-modeline/config.el @@ -473,7 +473,7 @@ lines are selected, or the NxM dimensions of a block selection." (cons evil-visual-beginning evil-visual-end) (cons (region-beginning) (region-end))) (propertize - (let ((lines (count-lines beg (min (1+ end) (point-max))))) + (let ((lines (count-lines beg (min end (point-max))))) (concat (cond ((or (bound-and-true-p rectangle-mark-mode) (eq 'block evil-visual-selection)) (let ((cols (abs (- (doom-column end) @@ -482,9 +482,9 @@ lines are selected, or the NxM dimensions of a block selection." ((eq 'line evil-visual-selection) (format "%dL" lines)) ((> lines 1) - (format "%dC %dL" (- (1+ end) beg) lines)) + (format "%dC %dL" (- end beg) lines)) (t - (format "%dC" (- (1+ end) beg)))) + (format "%dC" (- end beg)))) (when +doom-modeline-enable-word-count (format " %dW" (count-words beg end))))) 'face 'doom-modeline-highlight))))