Closed ysndr closed 6 months ago
Draft, because I mean to add derive support and docs, but I'd like to gather a response to the general approach, before spending more time on it.
I'm not opposed to making it configurable even though I'm curious about the motivation.
Implementation looks about right.
For once 100 characters might not be universally agreed upon (terminals commonly defaulting to 80, ssh reporting a term width of 80, etc). Proposing to change bpafs default to another opinionated value seemed hypocritical. Additionally, providing a config like this allows to adapt to the reported terminal width as well if so desired by the calling application.
Let me know if you need any help with that change :)
Alright, derive support is in as well now, and fixed the tests that broke due to including the next word width in the breaking decision.
CI failure is not related to your changes. I guess I need to decide how much effort I'm willing to put into supporting rustc 1.56... Will try to fix it tomorrow-ish.
bpaf
currently applies column wrapping at a hardcoded width of 100 characters.This PR aims to make this width configurable via the option parser. Additionally it contributes a fix to the breaking logic where earlier only the current cursor position was used to determine, resulting in the trailing word overflowing the set width of 100.