diff options
| author | ZyX <kp-pav@yandex.ru> | 2017-11-26 15:54:03 +0300 | 
|---|---|---|
| committer | ZyX <kp-pav@yandex.ru> | 2017-11-26 15:54:03 +0300 | 
| commit | b9c78130587e42ca3b6417b47fb739a166da8eb7 (patch) | |
| tree | 142cf7dd0a87dfb32a20838e7683dd1980e4b3e7 /src/nvim/syntax.c | |
| parent | 05a3c12118a6dae0ac8f3603f9ee4d9fd9450cce (diff) | |
| parent | 207b7ca4bc16d52641eaa5244eef25a0dba91dbc (diff) | |
| download | rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.gz rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.tar.bz2 rneovim-b9c78130587e42ca3b6417b47fb739a166da8eb7.zip | |
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/syntax.c')
| -rw-r--r-- | src/nvim/syntax.c | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index bb7008b0ac..8e5a119b1f 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -4009,10 +4009,10 @@ get_syn_options (  {    char_u      *gname_start, *gname;    int syn_id; -  int len; +  int len = 0;    char        *p;    int fidx; -  static struct flag { +  static const struct flag {      char    *name;      int argtype;      int flags; @@ -4035,7 +4035,7 @@ get_syn_options (                    {"cCoOnNtTaAiInNsS",        1,      0},                    {"cCoOnNtTaAiInNeEdDiInN",  2,      0},                    {"nNeExXtTgGrRoOuUpP",      3,      0},}; -  static char *first_letters = "cCoOkKeEtTsSgGdDfFnN"; +  static const char *const first_letters = "cCoOkKeEtTsSgGdDfFnN";    if (arg == NULL)              /* already detected error */      return NULL; @@ -4055,9 +4055,10 @@ get_syn_options (      for (fidx = ARRAY_SIZE(flagtab); --fidx >= 0; ) {        p = flagtab[fidx].name;        int i; -      for (i = 0, len = 0; p[i] != NUL; i += 2, ++len) +      for (i = 0, len = 0; p[i] != NUL; i += 2, ++len) {          if (arg[len] != p[i] && arg[len] != p[i + 1])            break; +      }        if (p[i] == NUL && (ascii_iswhite(arg[len])                            || (flagtab[fidx].argtype > 0                                ? arg[len] == '=' @@ -6853,7 +6854,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)    if (error && idx == highlight_ga.ga_len) {      syn_unadd_group();    } else { -    if (is_normal_group) { +    if (!error && is_normal_group) {        // Need to update all groups, because they might be using "bg" and/or        // "fg", which have been changed now.        highlight_attr_set_all(); | 
