You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the function is responsible for two independent tasks:
running a report and creating a new buffer to display ledger’s output.
In some situations, it may be convenient to be able to run a report
without immediately displaying the output (e.g., because the user wants
to perform some post-processing or the user wants to send the output
somewhere else). Also, it is better to have functions that perform a
single, simple, task than to have monolithic functions that perform
multiple tasks.
This commit addresses the above by splitting ledger#report() into two
functions:
- ledger#report(): now this just runs a ledger’s command and returns the
output as a String.
- ledger#output(): this new function takes a String containing a report
and creates a new buffer to display it.
Both functions have suitable return values that the user may use to
check a function’s result (note that, before this commit,
ledger#report() does not return anything).
This change is backward-compatible and should cause no regressions. In
particular, the behaviour of the :Ledger command remains unchanged.
0 commit comments