branch: elpa/popon
commit 6d7ee4f32b6efc42045104c04088115de49b7d30
Author: Akib Azmain Turja <[email protected]>
Commit: Akib Azmain Turja <[email protected]>
Don't mess up line numbers
---
popon.el | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/popon.el b/popon.el
index cd14e332ce..87985ecc6e 100644
--- a/popon.el
+++ b/popon.el
@@ -262,10 +262,13 @@ when LINE-BEGINNINGS was calculated.")
(unless line
(setq line i)
(setf (alist-get mark point-to-line) line))
- (push (list (string-trim-right (buffer-substring mark (point))
- "\n")
- nil line mark (point))
- framebuffer))
+ (let ((str (buffer-substring mark (point)))
+ (disp-str (string-trim-right
+ (buffer-substring mark (point))
+ "\n")))
+ (push (list (string-trim-right disp-str) nil line mark
+ (if (equal str disp-str) (point) (1- (point))))
+ framebuffer)))
(push (cons mark (point)) line-boundaries)
(setq mark (point)))))
(let ((line-beginnings nil))
@@ -317,12 +320,6 @@ when LINE-BEGINNINGS was calculated.")
(cdr line)))
(setq current-offset (car line)))
(add-face-text-property 0 (length text) 'default 'append text)
- (when (or (not (= (cdar block) (point-max)))
- (not (< (caar block) (cdar block)))
- (equal (buffer-substring-no-properties
- (1- (cdar block)) (cdar block))
- "\n"))
- (setq text (concat text "\n")))
text))))))
(defun popon--redisplay-1 (force)