Fix JSON formatting regression

This commit is contained in:
Brian Buller 2019-10-16 15:33:16 -05:00
parent 1f3880f32e
commit 930ee1799e

View File

@ -598,7 +598,7 @@ func (screen *BrowserScreen) drawRightPane(style Style) {
startY += screen.drawMultilineText(pathString, 6, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg) startY += screen.drawMultilineText(pathString, 6, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg)
keyString := fmt.Sprintf("Key: %s", stringify([]byte(p.key))) keyString := fmt.Sprintf("Key: %s", stringify([]byte(p.key)))
startY += screen.drawMultilineText(keyString, 5, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg) startY += screen.drawMultilineText(keyString, 5, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg)
valString := fmt.Sprintf("Value: %s", stringify(formatValue([]byte(p.val)))) valString := fmt.Sprintf("Value: %s", formatValue([]byte(p.val)))
startY += screen.drawMultilineText(valString, 7, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg) startY += screen.drawMultilineText(valString, 7, startX, startY, (w/2)-1, style.defaultFg, style.defaultBg)
} }
} else { } else {
@ -615,7 +615,7 @@ func formatValue(val []byte) []byte {
if err == nil { if err == nil {
return out return out
} }
return []byte(val) return []byte(stringify([]byte(val)))
} }
func formatValueJSON(val []byte) ([]byte, error) { func formatValueJSON(val []byte) ([]byte, error) {