aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-14 11:23:33 +0800
committerGitHub <noreply@github.com>2022-11-14 11:23:33 +0800
commit6d996f78ef7e2f4baf19bc2ca6abce33305e2915 (patch)
tree278195d1b3ea284fac12805fac8e5d5f479b95e3
parentf2695919bbc4ffea894a54c1d48632ebf0d543a9 (diff)
downloadrneovim-6d996f78ef7e2f4baf19bc2ca6abce33305e2915.tar.gz
rneovim-6d996f78ef7e2f4baf19bc2ca6abce33305e2915.tar.bz2
rneovim-6d996f78ef7e2f4baf19bc2ca6abce33305e2915.zip
vim-patch:8.2.4001: insert complete code uses global variables
Problem: Insert complete code uses global variables. Solution: Make variables local to the file and use accessor functions. (Yegappan Lakshmanan, closes vim/vim#9470) https://github.com/vim/vim/commit/d94fbfc74a8b8073e7a256c95fa6f39fc527c726 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
-rw-r--r--src/nvim/insexpand.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c
index 91ac1d5e8c..bc10785152 100644
--- a/src/nvim/insexpand.c
+++ b/src/nvim/insexpand.c
@@ -242,7 +242,6 @@ static expand_T compl_xp;
// List of flags for method of completion.
static int compl_cont_status = 0;
-
#define CONT_ADDING 1 ///< "normal" or "adding" expansion
#define CONT_INTRPT (2 + 4) ///< a ^X interrupted the current expansion
///< it's set only iff N_ADDS is set
@@ -422,7 +421,7 @@ void compl_status_clear(void)
compl_cont_status = 0;
}
-// @return true if completion is using the forward direction matches
+/// @return true if completion is using the forward direction matches
static bool compl_dir_forward(void)
{
return compl_direction == FORWARD;
@@ -3297,7 +3296,7 @@ static int ins_compl_get_exp(pos_T *ini)
assert(st.ins_buf != NULL);
compl_old_match = compl_curr_match; // remember the last current match
- st.cur_match_pos = (compl_dir_forward() ? &st.last_match_pos : &st.first_match_pos);
+ st.cur_match_pos = compl_dir_forward() ? &st.last_match_pos : &st.first_match_pos;
// For ^N/^P loop over all the flags/windows/buffers in 'complete'
for (;;) {