示例#1
0
文件: draw.c 项目: jlsandell/tig
bool
draw_author(struct view *view, const struct ident *author)
{
	bool trim = author_trim(opt_author_width);
	const char *text = mkauthor(author, opt_author_width, opt_show_author);

	if (opt_show_author == AUTHOR_NO)
		return FALSE;

	return draw_field(view, LINE_AUTHOR, text, opt_author_width, ALIGN_LEFT, trim);
}
示例#2
0
文件: draw.c 项目: FAKERINHEART/tig
static bool
draw_author(struct view *view, struct view_column *column, const struct ident *author)
{
	bool trim = author_trim(column->width);
	const char *text = mkauthor(author, column->opt.author.width, column->opt.author.display);

	if (column->opt.author.display == AUTHOR_NO)
		return false;

	return draw_field(view, LINE_AUTHOR, text, column->width, ALIGN_LEFT, trim);
}
示例#3
0
文件: branch.c 项目: ebruck/tig
static bool
branch_grep(struct view *view, struct line *line)
{
	struct branch *branch = line->data;
	const char *text[] = {
		branch->ref->name,
		mkauthor(branch->author, opt_author_width, opt_show_author),
		NULL
	};

	return grep_text(view, text);
}
示例#4
0
文件: blame.c 项目: peff/tig
static bool
blame_grep(struct view *view, struct line *line)
{
	struct blame *blame = line->data;
	struct blame_commit *commit = blame->commit;
	const char *text[] = {
		blame->text,
		commit ? commit->title : "",
		commit ? commit->id : "",
		commit ? mkauthor(commit->author, opt_author_width, opt_show_author) : "",
		commit ? mkdate(&commit->time, opt_show_date) : "",
		NULL
	};

	return grep_text(view, text);
}