whitespace: allocate a few more bits and define WS_INCOMPLETE_LINE

Reserve a few more bits in the diff flags word to be used for future
whitespace rules.  Add WS_INCOMPLETE_LINE without implementing the
behaviour (yet).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2025-11-12 14:02:55 -08:00
parent 3a4eb5ad2e
commit a675104c39
5 changed files with 21 additions and 12 deletions

3
ws.h
View File

@@ -15,13 +15,14 @@ struct strbuf;
#define WS_CR_AT_EOL (1<<9)
#define WS_BLANK_AT_EOF (1<<10)
#define WS_TAB_IN_INDENT (1<<11)
#define WS_INCOMPLETE_LINE (1<<12)
#define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
#define WS_TAB_WIDTH_MASK ((1<<6)-1)
/* All WS_* -- when extended, adapt constants defined after diff.c:diff_symbol */
#define WS_RULE_MASK ((1<<12)-1)
#define WS_RULE_MASK ((1<<16)-1)
extern unsigned whitespace_rule_cfg;
unsigned whitespace_rule(struct index_state *, const char *);