comparison src/testdir/test_python3.vim @ 28950:44481ae7c7ce v8.2.4997

patch 8.2.4997: Python: changing hidden buffer can cause display mess up Commit: https://github.com/vim/vim/commit/37233f6022b3ed16985a91d22752b3ca162e21d0 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 22 12:23:48 2022 +0100 patch 8.2.4997: Python: changing hidden buffer can cause display mess up Problem: Python: changing hidden buffer can cause the display to be messed up. Solution: Do not mark changed lines when using another buffer. (Paul Ollis, closes #10437, closes #7972)
author Bram Moolenaar <Bram@vim.org>
date Sun, 22 May 2022 13:30:03 +0200
parents 485c7c4afeb7
children b9b8422ad671
comparison
equal deleted inserted replaced
28949:d9df9758824e 28950:44481ae7c7ce
4059 set fdm& fde& 4059 set fdm& fde&
4060 delfunc Fde 4060 delfunc Fde
4061 bwipe! Xa.txt 4061 bwipe! Xa.txt
4062 endfunc 4062 endfunc
4063 4063
4064 " Test to catch regression fix #10437.
4065 func Test_python3_hidden_buf_mod_does_not_mess_up_display()
4066 CheckRunVimInTerminal
4067
4068 let testfile = 'Xtest.vim'
4069 let lines =<< trim END
4070 set hidden number
4071 new
4072 hide
4073 sil call setline(1, repeat(['aaa'], &lines) + ['bbbbbb'])
4074 fu Func()
4075 python3 << EOF
4076 import vim
4077 b = vim.buffers[2]
4078 b[:] = ['', '']
4079 EOF
4080 endfu
4081 norm! Gzb
4082 call feedkeys(":call Func()\r", 'n')
4083 END
4084 call writefile(lines, testfile)
4085
4086 let rows = 10
4087 let bufnr = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
4088 call TermWait(bufnr, 100)
4089 call assert_equal('run', job_status(term_getjob(bufnr)))
4090 let g:test_is_flaky = 0
4091 call WaitForAssert({-> assert_match('^ 3 aaa$', term_getline(bufnr, 1))})
4092 call WaitForAssert({-> assert_match('^ 11 bbbbbb$', term_getline(bufnr, rows - 1))})
4093
4094 call term_sendkeys(bufnr, ":qall!\<CR>")
4095 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(bufnr)))})
4096 exe bufnr . 'bwipe!'
4097 call delete(testfile)
4098 endfunc
4099
4064 " vim: shiftwidth=2 sts=2 expandtab 4100 " vim: shiftwidth=2 sts=2 expandtab