ex: properly global insert with initial newline in inserted textmaster
commit957906b0e3bcc0f795cf8c6b7313fcc4ec338784
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 28 Dec 2024 14:09:35 +0000 (28 15:09 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 29 Dec 2024 11:45:22 +0000 (29 12:45 +0100)
tree5ef1b9f700ec08e1dd7f87c7b7277b254923fc3b
parente4630389a6b909f5956af99a72724c996462af20
ex: properly global insert with initial newline in inserted text

The line insertion was guarded by a test that would fail
to trigger on empty lines in the inserted text.
It is not clear why this guard appears in the code.
Removing the guard reportedly makes the code behave
in the same way as the original vi.
The version of vi that comes with AIX and that identifies itself
as "Version 3.10" also behaves in this way.

Reported-by: Mohamed Akram <mohd.akram@outlook.com>
Patch-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
ex/ex_append.c
tests/ex/global_insert_empty_line.ex [new file with mode: 0644]
tests/ex/global_insert_empty_line.out [new file with mode: 0644]
tests/ex/global_insert_empty_line2.ex [new file with mode: 0644]
tests/ex/global_insert_empty_line2.out [new file with mode: 0644]
tests/ex/global_insert_nothing2.ex [new file with mode: 0644]
tests/ex/global_insert_nothing2.out [new file with mode: 0644]
tests/ex/global_insert_trailing_newline2.ex [new file with mode: 0644]
tests/ex/global_insert_trailing_newline2.out [new file with mode: 0644]