Open mfederczuk opened 4 years ago
This bug appears because file_info_win()
only gets cleared at specific lines (where the information are shown) and not the whole window. Easy fix.
Yeah, but we should actually look for a proper way to fix this.
Just letting the file name automatically wrap doesn't look very good.
Maybe check the width of the terminal and check if the file name fits, if not, split the name manually and let it continue under where the name began
| Name: very-long-fi
| le-name-that
| wraps-severa
| l-times
We can use the positions of any _ - .
or spaces to split the file names up, e.g.:
Name: my-long-filename.txt
| Split it up in:
| my-
| long-
| filename.txt
Could write a function to help with that:
std::vector<std::string> split_file_name(
const std::string &file_name,
unsigned int max_length,
const std::string &wrap_chars = "_-.");
Of course we also gotta move the rest of the file infos down accordingly.
Files with a very long name wrap and continue in the next line.
After selecting a different file, the wrapped part still stays since the window doesn't get cleared.