diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-07 21:32:11 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-17 07:02:44 -0300 |
commit | b4efff652388260b548324f870201a5804e097f0 (patch) | |
tree | b7afb575a4640ef28e06b6a6519839420996a492 /src/nvim/syntax.c | |
parent | 659cd0e99a0993497279ef8538956eec9f2fc374 (diff) | |
download | rneovim-b4efff652388260b548324f870201a5804e097f0.tar.gz rneovim-b4efff652388260b548324f870201a5804e097f0.tar.bz2 rneovim-b4efff652388260b548324f870201a5804e097f0.zip |
Replace ga->ga_len > 0 checks with !GA_EMPTY(ga)
Used Coccinelle to perform the changes
```diff
@@
expression E;
@@
<...
(
- E.ga_len > 0
+ !GA_EMPTY(&E)
|
- E->ga_len > 0
+ !GA_EMPTY(E)
)
...>
```
`spatch --in-place --sp-file ga_empty.cocci <C_FILE>`
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index bfe13212ce..6fc62aed9a 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -951,7 +951,7 @@ static void syn_start_line(void) * Need to update the end of a start/skip/end that continues from the * previous line and regions that have "keepend". */ - if (current_state.ga_len > 0) { + if (!GA_EMPTY(¤t_state)) { syn_update_ends(TRUE); check_state_ends(); } @@ -2187,7 +2187,7 @@ syn_current_attr ( */ if (!syncing && !keep_state) { check_state_ends(); - if (current_state.ga_len > 0 + if (!GA_EMPTY(¤t_state) && syn_getcurline()[current_col] != NUL) { ++current_col; check_state_ends(); @@ -2207,7 +2207,7 @@ syn_current_attr ( && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) current_next_list = NULL; - if (zero_width_next_ga.ga_len > 0) + if (!GA_EMPTY(&zero_width_next_ga)) ga_clear(&zero_width_next_ga); /* No longer need external matches. But keep next_match_extmatch. */ |