Merge pull request #457 from vivien/text-variable
[tig.git] / include / tig / diff.h
blobf28a4429bfa8ff544934fc1b7f6add9ab8f0ba62
1 /* Copyright (c) 2006-2015 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef TIG_DIFF_H
15 #define TIG_DIFF_H
17 #include "tig/view.h"
19 struct diff_state {
20 bool after_commit_title;
21 bool after_diff;
22 bool reading_diff_stat;
23 bool combined_diff;
24 bool adding_describe_ref;
25 const char *file;
26 unsigned int lineno;
27 struct position pos;
30 enum request diff_common_edit(struct view *view, enum request request, struct line *line);
31 bool diff_common_read(struct view *view, const char *data, struct diff_state *state);
32 enum request diff_common_enter(struct view *view, enum request request, struct line *line);
33 struct line *diff_common_add_diff_stat(struct view *view, const char *text, size_t offset);
34 void diff_common_select(struct view *view, struct line *line, const char *changes_msg);
35 void diff_save_line(struct view *view, struct diff_state *state, enum open_flags flags);
36 void diff_restore_line(struct view *view, struct diff_state *state);
38 unsigned int diff_get_lineno(struct view *view, struct line *line);
39 const char *diff_get_pathname(struct view *view, struct line *line);
41 extern struct view diff_view;
43 static inline void
44 open_diff_view(struct view *prev, enum open_flags flags)
46 open_view(prev, &diff_view, flags);
49 #endif
50 /* vim: set ts=8 sw=8 noexpandtab: */