aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-25 11:17:29 +0800
committerGitHub <noreply@github.com>2022-08-25 11:17:29 +0800
commitee02141c7b8a2dd1a87fe4bfc743f39750c99249 (patch)
tree0eb53db012b149e0db32770473187f2bec10ce76 /src/nvim/edit.c
parent674d3b2d5f5f7ade20cbd88ed64d63a80bb7b302 (diff)
parentb1833bb33b49a26e7552548e3541ac1480fee452 (diff)
downloadrneovim-ee02141c7b8a2dd1a87fe4bfc743f39750c99249.tar.gz
rneovim-ee02141c7b8a2dd1a87fe4bfc743f39750c99249.tar.bz2
rneovim-ee02141c7b8a2dd1a87fe4bfc743f39750c99249.zip
Merge pull request #19937 from zeertzjq/vim-8.2.3942
vim-patch:8.2.{3942,partial:4001}
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 545f3c0d9a..81a67b86c3 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -92,6 +92,10 @@ typedef struct insert_state {
#define BACKSPACE_WORD_NOT_SPACE 3
#define BACKSPACE_LINE 4
+/// Set when doing something for completion that may call edit() recursively,
+/// which is not allowed.
+static bool compl_busy = false;
+
static colnr_T Insstart_textlen; // length of line when insert started
static colnr_T Insstart_blank_vcol; // vcol for first inserted blank
static bool update_Insstart_orig = true; // set Insstart_orig to Insstart
@@ -1091,7 +1095,7 @@ check_pum:
// but it is under other ^X modes
if (*curbuf->b_p_cpt == NUL
&& (ctrl_x_mode_normal() || ctrl_x_mode_whole_line())
- && !(compl_cont_status & CONT_LOCAL)) {
+ && !compl_status_local()) {
goto normalchar;
}
@@ -1177,9 +1181,11 @@ normalchar:
static void insert_do_complete(InsertState *s)
{
compl_busy = true;
+ disable_fold_update++; // don't redraw folds here
if (ins_complete(s->c, true) == FAIL) {
- compl_cont_status = 0;
+ compl_status_clear();
}
+ disable_fold_update--;
compl_busy = false;
can_si = may_do_si(); // allow smartindenting
}