fix(completion): avoid deleting text when completion leader changes #31448

Problem:  When completion leader changes, text that might be reinserted
          immediately after is deleted. This unnecessarily affects
          extmarks. #31387 restored the original extmarks but that
          prevents end_right_gravity marks from growing.
Solution: Avoid deleting leader text that will be reinserted.
This commit is contained in:
luukvbaal
2024-12-06 13:07:52 +01:00
committed by GitHub
parent e9f4ceeb74
commit e788d1a3a9
3 changed files with 38 additions and 13 deletions

View File

@@ -604,7 +604,7 @@ static int insert_execute(VimState *state, int key)
|| (ins_compl_enter_selects()
&& (s->c == CAR || s->c == K_KENTER || s->c == NL)))
&& stop_arrow() == OK) {
ins_compl_delete();
ins_compl_delete(false);
ins_compl_insert(false);
}
}