From 6d996f78ef7e2f4baf19bc2ca6abce33305e2915 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 14 Nov 2022 11:23:33 +0800 Subject: 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 --- src/nvim/insexpand.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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 (;;) { -- cgit