summaryrefslogtreecommitdiffstats
path: root/src/ops.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-06-11 20:30:14 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-11 20:37:59 +0200
commit1fb9eae5794c3f808468fbc2935c5144f9e0b5b1 (patch)
tree80138299495f67c2edb41ed63074ce9fed8116a0 /src/ops.c
parent959c3c887b2e52c7141b2a09a53634481911b1b7 (diff)
patch 9.1.0477: block_editing errors out when using <enter>v9.1.0477
Problem: block_editing errors out when using <enter> (Ali Rizvi-Santiago, after v9.1.0274) Solution: Change ins_len from size_t to int so that the test if ins_len is negative actually works properly Add a test, so that this doesn't regress. fixes: #14960 Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ops.c b/src/ops.c
index b9569571ef..eb75c34b1b 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1814,7 +1814,7 @@ op_change(oparg_T *oap)
*/
if (oap->block_mode && oap->start.lnum != oap->end.lnum && !got_int)
{
- size_t ins_len;
+ int ins_len;
// Auto-indenting may have changed the indent. If the cursor was past
// the indent, exclude that indent change from the inserted text.
@@ -1827,7 +1827,7 @@ op_change(oparg_T *oap)
bd.textcol += new_indent - pre_indent;
}
- ins_len = ml_get_len(oap->start.lnum) - pre_textlen;
+ ins_len = (int)ml_get_len(oap->start.lnum) - pre_textlen;
if (ins_len > 0)
{
// Subsequent calls to ml_get() flush the firstline data - take a