diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-08-18 15:45:17 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-08-18 15:45:17 -0400 |
commit | 2e8201b28b2b78a77eb8a0d4eb41e231f6fef85d (patch) | |
tree | acd8b18235b9f421011b92cb9a38f61c8926769f /src/preview | |
parent | f8851c7f9ac22289e473a2911611958e361befdc (diff) |
replace tab characters with 8 spaces for file text previews
Diffstat (limited to 'src/preview')
-rw-r--r-- | src/preview/preview_file.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/preview/preview_file.rs b/src/preview/preview_file.rs index 4e6f264..4d454e7 100644 --- a/src/preview/preview_file.rs +++ b/src/preview/preview_file.rs @@ -19,6 +19,8 @@ pub struct FilePreview { impl std::convert::From<(path::PathBuf, Output)> for FilePreview { fn from((p, output): (path::PathBuf, Output)) -> Self { let s = String::from_utf8_lossy(&output.stdout).to_string(); + let s2 = s.replace('\t', " "); + let s = s2.to_string(); let status = output.status; Self { _path: p, |