aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorFelipe Oliveira Carvalho <felipekde@gmail.com>2014-05-07 21:32:11 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-17 07:02:44 -0300
commitb4efff652388260b548324f870201a5804e097f0 (patch)
treeb7afb575a4640ef28e06b6a6519839420996a492 /src/nvim/ex_getln.c
parent659cd0e99a0993497279ef8538956eec9f2fc374 (diff)
downloadrneovim-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/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index d5410346aa..db9a483040 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1831,7 +1831,7 @@ getexmodeline (
if (c1 == BS || c1 == K_BS
|| c1 == DEL || c1 == K_DEL || c1 == K_KDEL) {
- if (line_ga.ga_len > 0) {
+ if (!GA_EMPTY(&line_ga)) {
--line_ga.ga_len;
goto redraw;
}
@@ -1940,7 +1940,7 @@ redraw:
/* We are done when a NL is entered, but not when it comes after an
* odd number of backslashes, that results in a NUL. */
- if (line_ga.ga_len > 0 && pend[-1] == '\n') {
+ if (!GA_EMPTY(&line_ga) && pend[-1] == '\n') {
int bcount = 0;
while (line_ga.ga_len - 2 >= bcount && pend[-2 - bcount] == '\\')