From cd85291e8efaf0b4a7ebd356b22ce2b7453fbd4c Mon Sep 17 00:00:00 2001 From: Eivind Fonn Date: Sun, 5 Jul 2015 21:09:11 +0200 Subject: [PATCH] Fix selection-info when region reaches buffer end --- spacemacs/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 03f3903e6..4000bbf99 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -2766,7 +2766,7 @@ It is a string holding: - the number of columns in the selection if it covers only one line, - the number of lines in the selection if if covers several full lines - or rowsxcols if it's a block selection." - (let* ((lines (count-lines (region-beginning) (1+ (region-end)))) + (let* ((lines (count-lines (region-beginning) (min (1+ (region-end)) (point-max)))) (chars (- (1+ (region-end)) (region-beginning))) (cols (1+ (abs (- (column-number-at-pos (region-end)) (column-number-at-pos (region-beginning)))))))