ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
370 stars 56 forks source link

"Nothing to reconcile" #123

Open BackSeat opened 3 years ago

BackSeat commented 3 years ago

Running: 96ec5f9 - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #112 from kcwu/post-state (6 months ago)

Using hledger

Enter :Reconcile and I get "Nothing to reconcile"

Probably user error. What should I look for?

insanerwayner commented 3 years ago

I also am getting this with hedger. Something else that needs to be configured? Here's my rc:

" vim-ledger
au BufNewFile,BufRead *.ldg,*.ledger setf ledger | comp ledger
au FileType ledger noremap { ?^\d<CR>
au FileType ledger noremap } /^\d<CR>
" let g:ledger_bin = '/usr/bin/hledger'
let g:ledger_is_hledger = 1
let g:ledger_maxwidth = 80
let g:ledger_fillstring = '    -'
let g:ledger_detailed_first = 1
let g:ledger_fold_blanks = 0
let g:ledger_date_format = '%Y-%m-%d'
set nowrap
noremap <silent><buffer> <F5> :call ledger#transaction_state_toggle(line('.'), '!* ')<CR>
let g:ledger_maxwidth = 120
let g:ledger_fold_blanks = 1
function LedgerSort()
    :%! hledger -f - print
    :%LedgerAlign
    :normal Gdd
endfunction
command LedgerSort call LedgerSort()
noremap <silent><buffer> <F6> :LedgerSort<CR>
BackSeat commented 2 years ago

@alerque I'd love to see this working. I've tried a few older versions from git history, but all give the same error.

It's Open Source: I know I get to break it and keep all the bits. If you're able to give any pointers to debugging this, I'd be very grateful (I find Vimscript a bit opaque, but with some clues I may be able to make some progress). If more information would help, just tell me what you need.

Thanks, Keith

alerque commented 2 years ago

I'm sorry, I don't actually have a good idea what to look for on this on. I'm happy to facilitate a fix if somebody has one, but my FOSS time is kind of being sucked up by some other projects right now (and my personal finances are behind, maybe when I get to them...).

parmort commented 2 years ago

I can try to take a crack at solving this. Could you provide a sample register where you still get the same errors?

lc-at commented 1 year ago

Any update on this issue? I experienced the same issue.

@parmort, here is my sample register.

2022-10-14 Opening balances
        assets:checking:example  $10
        equity

2022-10-14 Grocery shop
        expenses:groceries  $5
        assets:checking:example

My .vimrc config for vim-ledger:

let g:ledger_bin = '/usr/bin/hledger'
let g:ledger_maxwidth = 120
let g:ledger_fold_blanks = 1
let g:ledger_is_hledger = 1

if !exists('g:ledger_extra_options')
        let g:ledger_extra_options = ''
endif
alerque commented 1 year ago

As far as I can see from a cursory review of the code, the Reconcile command (ledger#reconcile() function) just does not support hledger at all. The arguments it tries to pass are only compatibly with ledger. I am not in a position to contribute support for heldger at the moment but if somebody does look into it and figure out what arguments to adjust to make it work I'd be happy to facilitate getting a PR merged.

@parmort feel free to take a swing at this, or if you think you won't get to it lets note that here so somebody else can try without feeling like they may be duplicating effort.

@p4kl0nc4t Thanks for the MWE, that example does show the error for me when configured with hledger and also works as expected (I think) with ledger.