MCPcopy Index your code
hub / github.com/git-bug/git-bug / getColumnWidths

Method getColumnWidths

termui/bug_table.go:283–299  ·  view source on GitHub ↗
(maxX int)

Source from the content-addressed store, hash-verified

281}
282
283func (bt *bugTable) getColumnWidths(maxX int) map[string]int {
284 m := make(map[string]int)
285 m["id"] = 7
286 m["status"] = 6
287
288 left := maxX - 5 - m["id"] - m["status"]
289
290 m["comments"] = 3
291 left -= m["comments"]
292 m["lastEdit"] = 14
293 left -= m["lastEdit"]
294
295 m["author"] = minInt(maxInt(left/3, 15), 10+left/8)
296 m["title"] = maxInt(left-m["author"], 10)
297
298 return m
299}
300
301func (bt *bugTable) render(v *gocui.View, maxX int) {
302 columnWidths := bt.getColumnWidths(maxX)

Callers 2

renderMethod · 0.95
renderHeaderMethod · 0.95

Calls 2

minIntFunction · 0.85
maxIntFunction · 0.85

Tested by

no test coverage detected