ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
372 stars 55 forks source link

Use strdisplaywidth() to calculate foldtext width #84

Closed ropery closed 5 years ago

ropery commented 5 years ago

Fixes issue #82, which was filed two weeks ago by myself.

The s:multibyte_strlen custom function should be removed too, having no more any user.

Note I have no experience with vim-script. My approach here isn't clever, but I hope is rather straightforward. I have tested with let g:ledger_fillstring = "xyz", with narrow windows, and with very long amounts. One possible concern might be performance, as the while loops are pretty dumb.

alerque commented 5 years ago

I'm sorry this has gone un-reviewed. I missed in in the shuffle somewhere.

alerque commented 5 years ago

I'm having a little trouble testing this. Neither this branch nor the current master are showing the amount field in the fold at all! I don't usually use folds so I might be doing something wrong...

Scratch that. I had unset all my ledger related options for testing this with the default new users will get. That included g:ledger_maxwidth, and my terminal was so big I wasn't even noticing the amount in the far right edge because I was expecting it at my usual width. Embarrassing.

alerque commented 5 years ago

Thank you for bot the issue report and the contribution to fix it @lolilolicon!