Merge branch 'js/configurable-tab'
* js/configurable-tab: Make the tab width used for whitespace checks configurable apply --whitespace=fix: fix tab-in-indent
This commit is contained in:
17
cache.h
17
cache.h
@ -1091,15 +1091,17 @@ void shift_tree_by(const unsigned char *, const unsigned char *, unsigned char *
|
||||
/*
|
||||
* whitespace rules.
|
||||
* used by both diff and apply
|
||||
* last two digits are tab width
|
||||
*/
|
||||
#define WS_BLANK_AT_EOL 01
|
||||
#define WS_SPACE_BEFORE_TAB 02
|
||||
#define WS_INDENT_WITH_NON_TAB 04
|
||||
#define WS_CR_AT_EOL 010
|
||||
#define WS_BLANK_AT_EOF 020
|
||||
#define WS_TAB_IN_INDENT 040
|
||||
#define WS_BLANK_AT_EOL 0100
|
||||
#define WS_SPACE_BEFORE_TAB 0200
|
||||
#define WS_INDENT_WITH_NON_TAB 0400
|
||||
#define WS_CR_AT_EOL 01000
|
||||
#define WS_BLANK_AT_EOF 02000
|
||||
#define WS_TAB_IN_INDENT 04000
|
||||
#define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
|
||||
#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB)
|
||||
#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
|
||||
#define WS_TAB_WIDTH_MASK 077
|
||||
extern unsigned whitespace_rule_cfg;
|
||||
extern unsigned whitespace_rule(const char *);
|
||||
extern unsigned parse_whitespace_rule(const char *);
|
||||
@ -1108,6 +1110,7 @@ extern void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *str
|
||||
extern char *whitespace_error_string(unsigned ws);
|
||||
extern void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
|
||||
extern int ws_blank_line(const char *line, int len, unsigned ws_rule);
|
||||
#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
|
||||
|
||||
/* ls-files */
|
||||
int report_path_error(const char *ps_matched, const char **pathspec, int prefix_offset);
|
||||
|
Reference in New Issue
Block a user