Example #1
0
func newFormatter(wd string, termWidth uint16) *Formatter {
	var useColor bool
	if *enableColor {
		useColor = gg.ConfiguredBool(wd, "color.pager", false)
	}
	return NewFormatter(*pretty, *lineNumbers, useColor, *enableMarginLine, termWidth)
}
Example #2
0
func findText(wd, text string) {
	termHeight, _ := gx.CalculateDimensions()
	var useColor bool
	if !*noColor {
		useColor = gg.ConfiguredBool(wd, "color.pager", false)
	}
	pager := gx.NewPager(app, wd, gg.ConfiguredPager(wd), termHeight, *noPager)
	printer := NewPrinter(useColor, pager)
	fatalIfError(app, printer.PrintCommentsMatching(wd, text), "find")
}