aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-06-11 23:43:14 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-06-12 02:00:50 -0400
commit3c7ea8d619d77d303e9c51118b22c81a3ffbf550 (patch)
treeef78d44a18dca24302546d98a67861940d471e5f /src/nvim/edit.c
parentfa2ad305e312c3e61e4943c345a4c34d4a1be18c (diff)
downloadrneovim-3c7ea8d619d77d303e9c51118b22c81a3ffbf550.tar.gz
rneovim-3c7ea8d619d77d303e9c51118b22c81a3ffbf550.tar.bz2
rneovim-3c7ea8d619d77d303e9c51118b22c81a3ffbf550.zip
vim-patch:8.0.0451: some macros are in lower case
Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index f3e2663d76..cf6167c6ea 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -658,7 +658,7 @@ static int insert_execute(VimState *state, int key)
char_u *p;
if (str != NULL) {
- for (p = str; *p != NUL; mb_ptr_adv(p)) {
+ for (p = str; *p != NUL; MB_PTR_ADV(p)) {
ins_compl_addleader(PTR2CHAR(p));
}
xfree(str);
@@ -1196,7 +1196,7 @@ normalchar:
if (str != NULL) {
if (*str != NUL && stop_arrow() != FAIL) {
// Insert the new value of v:char literally.
- for (p = str; *p != NUL; mb_ptr_adv(p)) {
+ for (p = str; *p != NUL; MB_PTR_ADV(p)) {
s->c = PTR2CHAR(p);
if (s->c == CAR || s->c == K_KENTER || s->c == NL) {
ins_eol(s->c);
@@ -2008,8 +2008,8 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
const char_u *p = str;
actual_len = 0;
while (*p != NUL) {
- mb_ptr_adv(p);
- ++actual_len;
+ MB_PTR_ADV(p);
+ actual_len++;
}
} else
actual_len = len;
@@ -2019,8 +2019,8 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int
const char_u *p = compl_orig_text;
actual_compl_length = 0;
while (*p != NUL) {
- mb_ptr_adv(p);
- ++actual_compl_length;
+ MB_PTR_ADV(p);
+ actual_compl_length++;
}
} else
actual_compl_length = compl_length;
@@ -2322,8 +2322,8 @@ static void ins_compl_longest_match(compl_T *match)
break;
}
if (has_mbyte) {
- mb_ptr_adv(p);
- mb_ptr_adv(s);
+ MB_PTR_ADV(p);
+ MB_PTR_ADV(s);
} else {
++p;
++s;
@@ -2974,7 +2974,7 @@ static int ins_compl_bs(void)
line = get_cursor_line_ptr();
p = line + curwin->w_cursor.col;
- mb_ptr_back(line, p);
+ MB_PTR_BACK(line, p);
// Stop completion when the whole word was deleted. For Omni completion
// allow the word to be deleted, we won't match everything.
@@ -3440,8 +3440,9 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
;
if (len > 0)
len -= (*mb_head_off)(p, p + len);
- for (p += len; *p != NUL; mb_ptr_adv(p))
+ for (p += len; *p != NUL; MB_PTR_ADV(p)) {
AppendCharToRedobuff(K_BS);
+ }
} else {
len = 0;
}
@@ -4597,13 +4598,15 @@ static int ins_complete(int c, bool enable_pum)
if (startcol > 0) {
char_u *p = line + startcol;
- mb_ptr_back(line, p);
- while (p > line && vim_isfilec(PTR2CHAR(p)))
- mb_ptr_back(line, p);
- if (p == line && vim_isfilec(PTR2CHAR(p)))
+ MB_PTR_BACK(line, p);
+ while (p > line && vim_isfilec(PTR2CHAR(p))) {
+ MB_PTR_BACK(line, p);
+ }
+ if (p == line && vim_isfilec(PTR2CHAR(p))) {
startcol = 0;
- else
+ } else {
startcol = (int)(p - line) + 1;
+ }
}
compl_col += startcol;