Skip to content

Commit 5243dd2

Browse files
authored
Merge pull request #452 from ledger/fix-visit-source
Fix visit source
2 parents c54d5e4 + 56bc296 commit 5243dd2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ledger-report.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; ledger-report.el --- Helper code for use with the "ledger" command-line tool -*- lexical-binding: t; -*-
1+
;; ledger-report.el --- Helper code for use with the "ledger" command-line tool -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2003-2016 John Wiegley (johnw AT gnu DOT org)
44

@@ -553,12 +553,14 @@ specific posting at point instead."
553553
(interactive)
554554
(let* ((prop (get-text-property (point) 'ledger-source))
555555
(file (car prop))
556-
(line (cdr prop)))
557-
(when (and file line)
556+
(xact-position (cdr prop)))
557+
(when (and file xact-position)
558558
(find-file-other-window file)
559559
(widen)
560-
(goto-char (point-min))
561-
(forward-line (1- line))
560+
(if (markerp xact-position)
561+
(goto-char xact-position)
562+
(progn (goto-char (point-min))
563+
(forward-line (1- xact-position))))
562564
(when ledger-report-links-beginning-of-xact
563565
(ledger-navigate-beginning-of-xact)))))
564566

0 commit comments

Comments
 (0)