Skip to content

Commit

Permalink
vim-tiny fails on CTRL-X/CTRl-A
Browse files Browse the repository at this point in the history
Problem:  vim-tiny fails on CTRL-X/CTRl-A
          (Rob Foehl, after 9.1.0172)
Solution: Move #ifdefs, so that after changing the line in del_bytes,
          the cached textlen value is invalidated

Signed-off-by: Christian Brabandt <[email protected]>
  • Loading branch information
chrisbra committed Jul 8, 2024
1 parent b975ddf commit 0d69c2e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/change.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,17 +1355,17 @@ del_bytes(
mch_memmove(newp + col, oldp + col + count, (size_t)movelen);
if (alloc_newp)
ml_replace(lnum, newp, FALSE);
#ifdef FEAT_PROP_POPUP
else
{
#ifdef FEAT_PROP_POPUP
// Also move any following text properties.
if (oldlen + 1 < curbuf->b_ml.ml_line_len)
mch_memmove(newp + newlen + 1, oldp + oldlen + 1,
(size_t)curbuf->b_ml.ml_line_len - oldlen - 1);
#endif
curbuf->b_ml.ml_line_len -= count;
curbuf->b_ml.ml_line_textlen = 0;
}
#endif

// mark the buffer as changed and prepare for displaying
inserted_bytes(lnum, col, -count);
Expand Down
6 changes: 4 additions & 2 deletions src/testdir/Make_all.mak
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ SCRIPTS_TINY = \
test24 \
test25 \
test26 \
test27
test27 \
test28

SCRIPTS_TINY_OUT = \
test10.out \
Expand All @@ -31,7 +32,8 @@ SCRIPTS_TINY_OUT = \
test24.out \
test25.out \
test26.out \
test27.out
test27.out \
test28.out

# Tests for Vim9 script.
TEST_VIM9 = \
Expand Down
13 changes: 13 additions & 0 deletions src/testdir/test28.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Test for using CTRL-A/CTRL-X in tiny mode

STARTTEST
/12352
/12354
:/^STARTHERE/+,$w! test.out
:qa!
ENDTEST

STARTHERE
12352

12354
3 changes: 3 additions & 0 deletions src/testdir/test28.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
12353

12353

0 comments on commit 0d69c2e

Please sign in to comment.