diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-21 23:08:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-21 23:08:59 +0200 |
commit | 396b7c78c0fd9cd07528963b18c27398491df40d (patch) | |
tree | 34e4afda06906bd4fb7662c4ea9adb02a670fa6f /src/testdir/test_textformat.vim | |
parent | 34ba06b6e6f94bb46062e6c85dbfdcbb0d255ada (diff) | |
download | vim-git-396b7c78c0fd9cd07528963b18c27398491df40d.tar.gz |
patch 8.1.2198: crash when using :center in autocommandv8.1.2198
Problem: Crash when using :center in autocommand.
Solution: Bail out early for an empty line. (Dominique pelle, closes #5095)
Diffstat (limited to 'src/testdir/test_textformat.vim')
-rw-r--r-- | src/testdir/test_textformat.vim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim index 13fb50b98..3a0552b83 100644 --- a/src/testdir/test_textformat.vim +++ b/src/testdir/test_textformat.vim @@ -1,4 +1,7 @@ " Tests for the various 'formatoptions' settings + +source check.vim + func Test_text_format() enew! @@ -489,3 +492,20 @@ func Test_format_list_auto() bwipe! set fo& ai& bs& endfunc + +func Test_crash_github_issue_5095() + CheckFeature autocmd + + " This used to segfault, see https://github.com/vim/vim/issues/5095 + augroup testing + au BufNew x center + augroup END + + next! x + + bw + augroup testing + au! + augroup END + augroup! testing +endfunc |