Forráskód Böngészése

Merge pull request #17 from nwin/fix-column-alignment

Fix the column alignment
Ben S 11 éve
szülő
commit
bd8e73b212
2 módosított fájl, 2 hozzáadás és 2 törlés
  1. 1 1
      src/column.rs
  2. 1 1
      src/file.rs

+ 1 - 1
src/column.rs

@@ -86,7 +86,7 @@ impl Cell {
     pub fn paint(style: Style, string: &str) -> Cell {
         Cell {
             text: style.paint(string).to_string(),
-            length: string.len(),
+            length: string.width(false),
         }
     }
 }

+ 1 - 1
src/file.rs

@@ -319,7 +319,7 @@ impl<'a> File<'a> {
                 DateFormat::parse("{2>:D} {:M} {2>:h}:{02>:m}").unwrap()
             }
             else {
-                DateFormat::parse("{2>:D} {:M} {4>:Y}").unwrap()
+                DateFormat::parse("{2>:D} {:M} {5>:Y}").unwrap()
             };
 
         Cell::paint(Blue.normal(), format.format(date, locale).as_slice())