Example #1
0
func showComments(pwd string) {
	termHeight, termWidth := gx.CalculateDimensions()
	pager := gx.NewPager(app, pwd, gg.ConfiguredPager(pwd), termHeight, !*enablePager)
	computeContextLines(pwd)
	diff := gc.DiffCommits(pwd, *revision, contextLines)
	app.FatalIfError(diff.Failure, "diff")
	formatter := newFormatter(pwd, termWidth)
	printer := newPrinter(pager, formatter)
	printer.PrintDiff(diff.Success.(*gc.Diff))
}
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")
}