Truncate extra-long lines in the left pane
This commit is contained in:
parent
4c01d82dfa
commit
8dba00b972
@ -567,8 +567,14 @@ func (screen *BrowserScreen) drawPair(bp *BoltPair, style Style, y int) int {
|
|||||||
prefixSpaces := strings.Repeat(" ", len(bp.GetPath())*2)
|
prefixSpaces := strings.Repeat(" ", len(bp.GetPath())*2)
|
||||||
pairString := prefixSpaces
|
pairString := prefixSpaces
|
||||||
pairString = fmt.Sprintf("%s%s: %s", pairString, bp.key, bp.val)
|
pairString = fmt.Sprintf("%s%s: %s", pairString, bp.key, bp.val)
|
||||||
|
if len(pairString) > w {
|
||||||
|
}
|
||||||
prefixSpaces = prefixSpaces + " "
|
prefixSpaces = prefixSpaces + " "
|
||||||
if len(pairString) > w {
|
if len(pairString) > w {
|
||||||
|
// The long pair strings are causing a problem, for now, truncate
|
||||||
|
pairString = pairString[:w-3] + "..."
|
||||||
|
}
|
||||||
|
/* TODO: Re-enable this when I figure out the display issue
|
||||||
// Long pair string, wrap it
|
// Long pair string, wrap it
|
||||||
// We're going to try to wrap it at the :, if we can
|
// We're going to try to wrap it at the :, if we can
|
||||||
if len(bp.GetPath())*2+len(bp.key)+1 > w {
|
if len(bp.GetPath())*2+len(bp.key)+1 > w {
|
||||||
@ -584,12 +590,13 @@ func (screen *BrowserScreen) drawPair(bp *BoltPair, style Style, y int) int {
|
|||||||
usedLines += screen.drawMultilineText(pairString, (len(bp.GetPath())*2)+2, 0, y+1, (w - 1), bucketFg, bucketBg)
|
usedLines += screen.drawMultilineText(pairString, (len(bp.GetPath())*2)+2, 0, y+1, (w - 1), bucketFg, bucketBg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if w-len(pairString) > 0 {
|
*/
|
||||||
pairString = fmt.Sprintf("%s%s", pairString, strings.Repeat(" ", (w-len(pairString))))
|
if w-len(pairString) > 0 {
|
||||||
}
|
pairString = fmt.Sprintf("%s%s", pairString, strings.Repeat(" ", (w-len(pairString))))
|
||||||
termboxUtil.DrawStringAtPoint(pairString, 0, y, bucketFg, bucketBg)
|
|
||||||
usedLines = 1
|
|
||||||
}
|
}
|
||||||
|
termboxUtil.DrawStringAtPoint(pairString, 0, y, bucketFg, bucketBg)
|
||||||
|
usedLines = 1
|
||||||
|
// }
|
||||||
return usedLines
|
return usedLines
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user