diff options
| author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-12 18:23:38 +0000 |
|---|---|---|
| committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-12 18:52:34 +0000 |
| commit | 1b0d6bcd53291d9a9d3e1252976bd22564db4fe5 (patch) | |
| tree | d787294a4c7551b10c73c85784d27ae9c50481da /src/nvim/testdir | |
| parent | 05c3d02380770445983914dae1bf48e6ef37a6f6 (diff) | |
| download | rneovim-1b0d6bcd53291d9a9d3e1252976bd22564db4fe5.tar.gz rneovim-1b0d6bcd53291d9a9d3e1252976bd22564db4fe5.tar.bz2 rneovim-1b0d6bcd53291d9a9d3e1252976bd22564db4fe5.zip | |
vim-patch:8.2.4359: crash when repeatedly using :retab
Problem: crash when repeatedly using :retab.
Solution: Bail out when the line is getting too long.
https://github.com/vim/vim/commit/6e28703a8e41f775f64e442c5d11ce1ff599aa3f
Cherry-pick e_resulting_text_too_long from v8.2.3492; put it in globals.h as
it will eventually be used in other files.
Add a modeline to test_retab.vim
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_retab.vim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index e7b8946ccf..1650a03876 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -69,6 +69,8 @@ func Test_retab() call assert_equal(" a b c ", Retab('!', 3)) call assert_equal(" a b c ", Retab('', 5)) call assert_equal(" a b c ", Retab('!', 5)) + + set tabstop& expandtab& endfunc func Test_retab_error() @@ -78,3 +80,22 @@ func Test_retab_error() call assert_fails('ret 10000', 'E475:') call assert_fails('ret 80000000000000000000', 'E475:') endfunc + +func Test_retab_endless() + new + call setline(1, "\t0\t") + let caught = 'no' + try + while 1 + set ts=4000 + retab 4 + endwhile + catch /E1240/ + let caught = 'yes' + endtry + bwipe! + set tabstop& +endfunc + + +" vim: shiftwidth=2 sts=2 expandtab |