comparison src/testdir/test_textformat.vim @ 18408:50c0a9fb07ae v8.1.2198

patch 8.1.2198: crash when using :center in autocommand Commit: https://github.com/vim/vim/commit/396b7c78c0fd9cd07528963b18c27398491df40d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 21 23:08:59 2019 +0200 patch 8.1.2198: crash when using :center in autocommand Problem: Crash when using :center in autocommand. Solution: Bail out early for an empty line. (Dominique pelle, closes https://github.com/vim/vim/issues/5095)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Oct 2019 23:15:03 +0200
parents 5ecac7734184
children bb87c5c1e29b
comparison
equal deleted inserted replaced
18407:3f9986aeb41a 18408:50c0a9fb07ae
1 " Tests for the various 'formatoptions' settings 1 " Tests for the various 'formatoptions' settings
2
3 source check.vim
4
2 func Test_text_format() 5 func Test_text_format()
3 enew! 6 enew!
4 7
5 setl noai tw=2 fo=t 8 setl noai tw=2 fo=t
6 call append('$', [ 9 call append('$', [
487 call feedkeys("3G0lli\<BS>\<BS>x\<Esc>", 'tx') 490 call feedkeys("3G0lli\<BS>\<BS>x\<Esc>", 'tx')
488 call assert_equal('2. defx ghi', getline(2)) 491 call assert_equal('2. defx ghi', getline(2))
489 bwipe! 492 bwipe!
490 set fo& ai& bs& 493 set fo& ai& bs&
491 endfunc 494 endfunc
495
496 func Test_crash_github_issue_5095()
497 CheckFeature autocmd
498
499 " This used to segfault, see https://github.com/vim/vim/issues/5095
500 augroup testing
501 au BufNew x center
502 augroup END
503
504 next! x
505
506 bw
507 augroup testing
508 au!
509 augroup END
510 augroup! testing
511 endfunc