diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-08-04 12:22:22 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-08-06 20:24:36 +0200 |
commit | c0993ed3433ef4111a39e59642d15b15261e8b68 (patch) | |
tree | cb2a4225d70dec491f96412f96ebcb7c5a391e9a /src/nvim/misc1.c | |
parent | b0e26199ec02c9b392af6161522004c55db0441f (diff) | |
download | rneovim-c0993ed3433ef4111a39e59642d15b15261e8b68.tar.gz rneovim-c0993ed3433ef4111a39e59642d15b15261e8b68.tar.bz2 rneovim-c0993ed3433ef4111a39e59642d15b15261e8b68.zip |
lua: support getting UTF-32 and UTF-16 sizes of replaced text
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 112ca6f287..a62fa6d585 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -780,6 +780,7 @@ open_line ( did_append = FALSE; } + inhibit_delete_count++; if (newindent || did_si ) { @@ -821,6 +822,7 @@ open_line ( did_si = false; } } + inhibit_delete_count--; /* * In REPLACE mode, for each character in the extra leader, there must be @@ -1685,7 +1687,7 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine) bool was_alloced = ml_line_alloced(); // check if oldp was allocated char_u *newp; if (was_alloced) { - curbuf->deleted_bytes += (size_t)oldlen+1; + ml_add_deleted_len(curbuf->b_ml.ml_line_ptr, oldlen); newp = oldp; // use same allocated memory } else { // need to allocate a new line newp = xmalloc((size_t)(oldlen + 1 - count)); |