aboutsummaryrefslogtreecommitdiff
path: root/syntax.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-02 11:06:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-03 09:59:37 +0200
commit87c7258ccc683965d2b6a5190f1e98d74c8d25d3 (patch)
tree7d8dfbe8efe4f23f9d6848c19be9e55e2bbb58b3 /syntax.h
parent860ad58af0e1c39d5ffda0474ed3c58aaa1ecca5 (diff)
downloadvis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.gz
vis-87c7258ccc683965d2b6a5190f1e98d74c8d25d3.tar.xz
Add :show command to display special symbols for whitespaces
Enable/disable by setting to 0/1 respectively: :set show spaces=0 tabs=0 newlines=1
Diffstat (limited to 'syntax.h')
-rw-r--r--syntax.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/syntax.h b/syntax.h
index 13fcb8c..c28a7ea 100644
--- a/syntax.h
+++ b/syntax.h
@@ -15,12 +15,27 @@ typedef struct {
regex_t regex; /* compiled form of the above rule */
} SyntaxRule;
+typedef struct {
+ char *symbol;
+ Color *color;
+} SyntaxSymbol;
+
+enum {
+ SYNTAX_SYMBOL_SPACE,
+ SYNTAX_SYMBOL_TAB,
+ SYNTAX_SYMBOL_TAB_FILL,
+ SYNTAX_SYMBOL_EOL,
+ SYNTAX_SYMBOL_EOF,
+ SYNTAX_SYMBOL_LAST,
+};
+
typedef struct Syntax Syntax;
struct Syntax { /* a syntax definition */
char *name; /* syntax name */
char *file; /* apply to files matching this regex */
regex_t file_regex; /* compiled file name regex */
const char **settings;/* settings associated with this file type */
+ SyntaxSymbol symbols[SYNTAX_SYMBOL_LAST]; /* symbols for white space handling */
SyntaxRule rules[24]; /* all rules for this file type */
};