mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 14:55:33 +00:00
vim-patch:9.2.0040: completion: preinsert wrong with register completion (#38003)
Problem: completion: preinsert wrong with register completion
Solution: Remove preinserted text during register content insertion
(Girish Palya).
fixes: vim/vim#19329
closes: vim/vim#19474
3684ad83d1
Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "nvim/getchar.h"
|
||||
#include "nvim/globals.h"
|
||||
#include "nvim/indent.h"
|
||||
#include "nvim/insexpand.h"
|
||||
#include "nvim/keycodes.h"
|
||||
#include "nvim/mark.h"
|
||||
#include "nvim/mbyte.h"
|
||||
@@ -1301,6 +1302,11 @@ void do_put(int regname, yankreg_T *reg, int dir, int count, int flags)
|
||||
const pos_T orig_end = curbuf->b_op_end;
|
||||
unsigned cur_ve_flags = get_ve_flags(curwin);
|
||||
|
||||
// Remove any preinserted text (issue vim/vim#19329)
|
||||
if (ins_compl_preinsert_effect()) {
|
||||
ins_compl_delete(false);
|
||||
}
|
||||
|
||||
curbuf->b_op_start = curwin->w_cursor; // default for '[ mark
|
||||
curbuf->b_op_end = curwin->w_cursor; // default for '] mark
|
||||
|
||||
|
||||
Reference in New Issue
Block a user