Fix bug 1052 ledger-mode mangles transactions with tabs.
This commit is contained in:
parent
10bdcbb876
commit
3a2eb94bef
3 changed files with 14 additions and 4 deletions
|
|
@ -222,6 +222,7 @@ With a prefix argument, remove the effective date. "
|
|||
(defun ledger-mode-clean-buffer ()
|
||||
"indent, remove multiple linfe feeds and sort the buffer"
|
||||
(interactive)
|
||||
(untabify (point-min) (point-max))
|
||||
(ledger-sort-buffer)
|
||||
(ledger-post-align-postings (point-min) (point-max))
|
||||
(ledger-mode-remove-extra-lines))
|
||||
|
|
|
|||
|
|
@ -167,6 +167,15 @@ region align the posting on the current line."
|
|||
(goto-char end-region)
|
||||
(setq end-region (line-end-position))
|
||||
(goto-char begin-region)
|
||||
(goto-char
|
||||
(setq begin-region
|
||||
(line-beginning-position)))
|
||||
|
||||
(untabify begin-region end-region)
|
||||
|
||||
(goto-char end-region)
|
||||
(setq end-region (line-end-position))
|
||||
(goto-char begin-region)
|
||||
(goto-char
|
||||
(setq begin-region
|
||||
(line-beginning-position)))
|
||||
|
|
|
|||
|
|
@ -103,9 +103,9 @@ dropped."
|
|||
(skip-chars-forward " \t")
|
||||
(when (not (eq (ledger-state-from-char (char-after)) 'comment))
|
||||
(insert (ledger-char-from-state cur-status) " ")
|
||||
(if (search-forward " " (line-end-position) t)
|
||||
(if (looking-at " ")
|
||||
(delete-char 2))))
|
||||
(if (and (search-forward " " (line-end-position) t)
|
||||
(looking-at " "))
|
||||
(delete-char 2)))
|
||||
(forward-line))
|
||||
(setq new-status nil)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue