modify layer compare formatting

This commit is contained in:
Alex Goodman 2018-06-25 09:08:39 -04:00
parent 83dfb0ae6e
commit 1b99e24da9
No known key found for this signature in database
GPG Key ID: 05328C611D8A520E
3 changed files with 26 additions and 13 deletions

View File

@ -92,7 +92,7 @@ func (node *FileNode) String() string {
}
display = node.Name
if node.Data.FileInfo.TarHeader.Typeflag == tar.TypeSymlink || node.Data.FileInfo.TarHeader.Typeflag == tar.TypeLink {
display += " -> " + node.Data.FileInfo.TarHeader.Linkname
display += " " + node.Data.FileInfo.TarHeader.Linkname
}
return style.Sprint(display)
}

View File

@ -62,7 +62,7 @@ func (view *LayerView) Setup(v *gocui.View, header *gocui.View) error {
}
headerStr := fmt.Sprintf("C "+image.LayerFormat, "Image ID", "Size", "Command")
headerStr := fmt.Sprintf("Cmp "+image.LayerFormat, "Image ID", "Size", "Command")
fmt.Fprintln(view.header, Formatting.Header(vtclean.Clean(headerStr, false)))
return view.Render()
@ -96,11 +96,11 @@ func (view *LayerView) renderCompareBar(layerIdx int) string {
bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop := view.getCompareIndexes()
result := " "
if debug {
v, _ := view.gui.View("debug")
v.Clear()
_, _ = fmt.Fprintf(v, "bStart: %d bStop: %d tStart: %d tStop: %d", bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop)
}
//if debug {
// v, _ := view.gui.View("debug")
// v.Clear()
// _, _ = fmt.Fprintf(v, "bStart: %d bStop: %d tStart: %d tStop: %d", bottomTreeStart, bottomTreeStop, topTreeStart, topTreeStop)
//}
if layerIdx >= bottomTreeStart && layerIdx <= bottomTreeStop {
result = Formatting.CompareBottom(" ")
@ -108,6 +108,19 @@ func (view *LayerView) renderCompareBar(layerIdx int) string {
if layerIdx >= topTreeStart && layerIdx <= topTreeStop {
result = Formatting.CompareTop(" ")
}
//if bottomTreeStop == topTreeStart {
// result += " "
//} else {
// if layerIdx == bottomTreeStop {
// result += "─┐"
// } else if layerIdx == topTreeStart {
// result += "─┘"
// } else {
// result += " "
// }
//}
return result
}