Skip to content

Commit

Permalink
Remove some duplicate code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChickenProp committed Jul 23, 2024
1 parent 40c484d commit 1afb772
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ledger-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,8 @@ With a prefix argument, remove any effective dates."
(goto-char start)
(while (< (point) end)
(let ((context (car (ledger-context-at-point))))
(save-restriction
(narrow-to-region (line-beginning-position) (line-end-position))
(when (eq 'xact context)
(if should-remove
(ledger-remove-effective-date)
(beginning-of-line)
(re-search-forward ledger-iso-date-regexp)
(when (= (char-after) ?=)
(ledger-remove-effective-date))
(insert "=" date-string)))))
(when (eq 'xact context)
(ledger-insert-effective-date date-string)))
(forward-line 1)))))

(defun ledger-mode-remove-extra-lines ()
Expand Down

0 comments on commit 1afb772

Please sign in to comment.