summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Branham <alex.branham@gmail.com>2019-09-25 08:00:09 -0500
committerAlex Branham <alex.branham@gmail.com>2019-09-25 08:00:09 -0500
commit129dfbab2f744c8d6b6bcd406001ff527c262aff (patch)
treeb2a2307ffa7f9b23501d74f8f0f0a83f9752c7fe
parentaa65e334918ed4449c9de525ed3a272692839a97 (diff)
Fix links
We need to delete the region before checking if file-let var is bound, otherwise we leave some ugly artifacts behind, see bug #200. Closes #200
-rw-r--r--ledger-report.el8
1 files changed, 3 insertions, 5 deletions
diff --git a/ledger-report.el b/ledger-report.el
index 25094a4..78ed674 100644
--- a/ledger-report.el
+++ b/ledger-report.el
@@ -480,11 +480,9 @@ Optionally EDIT the command."
"Replace file and line annotations with buttons."
(while (re-search-forward "^\\(/[^:]+\\)?:\\([0-9]+\\)?:" nil t)
(let ((file (match-string 1))
- (line (string-to-number (match-string 2)))
- (beg (match-beginning 0))
- (end (match-end 0)))
- (when (and file line beg end)
- (delete-region beg end)
+ (line (string-to-number (match-string 2))))
+ (delete-region (match-beginning 0) (match-end 0))
+ (when (and file line)
(add-text-properties (line-beginning-position) (line-end-position)
(list 'ledger-source (cons file line)))
(make-text-button