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
{{ message }}
Repository navigation
g:ledger_dangerous_formatprg sets formatprg, but doesn't change gq behavior #177
gq uses formatexpr over formatprg if both are set, and even with the config mentioned in the title, both are set.
Thus if you really want to use the dangerous formatprg, you have to also setup an ftplugin to unset formatexpr. (Should vim-ledger do this automatically? I'm not sure, hence this issue as a discussion forum.)
Does #178 do what you expect? Caveat ... I haven't tested it myself yet, hence the draft PR. It might be there is a different way to unset that or perhaps we actually need to add a hook to the function we're binding to formatexpr and have the logic for passing off to the external formatter in there.
However the implementation needs to work I do think it is reasonable to assume if people set the dangerous option they probably want that to take effect.
I'll take a look; at first glance, execute can be dropped. I'll have to go refresh my memory on the various ways to {un,re}set options, though, as I think there's a "correct" way for this case (which might be exactly what you have).
Activity
alerque commentedon Feb 10, 2026
Does #178 do what you expect? Caveat ... I haven't tested it myself yet, hence the draft PR. It might be there is a different way to unset that or perhaps we actually need to add a hook to the function we're binding to formatexpr and have the logic for passing off to the external formatter in there.
However the implementation needs to work I do think it is reasonable to assume if people set the dangerous option they probably want that to take effect.
benknoble commentedon Feb 10, 2026
I'll take a look; at first glance,
executecan be dropped. I'll have to go refresh my memory on the various ways to {un,re}set options, though, as I think there's a "correct" way for this case (which might be exactly what you have).benknoble commentedon Feb 12, 2026
Commented on the PR; you're definitely in the right direction :)