reedline
reedline copied to clipboard
Fix wrong unit when split string
Fixes #837.
https://github.com/nushell/reedline/blob/4634f71705785a772c894aa45e30db88f3c7a8d5/src/menu/columnar_menu.rs#L305
split_at expect byte offset.
https://github.com/nushell/reedline/blob/4634f71705785a772c894aa45e30db88f3c7a8d5/src/menu/columnar_menu.rs#L302
But we given (got from width) isn't.
Thanks for all amazing works in reedline.
Yeah for anything involving string splitting .len is the relevant thing to get to the indices, while .width serves as a best guess for the layout width in the terminal. We need to be sure that the right thing is used in the right place.
There seems to be some preexisting history of display bugs leading to this
- #793
- #794
Thanks for your help. I can't reproduce #793 after change this line. match_len is used only to split string.
Works well, sorry about that.
The comment I wrote in #794 doesn't make sense, it is about str_len
shortest_base_string (in case all the results contains lots of special characters)
Thx for the fix!