diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-05 22:08:18 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-05 22:50:57 -0400 |
| commit | 44a331c36b5af25e51b072e8e77c478c2540ff43 (patch) | |
| tree | 473a977099f1d196f21c179f846459cfe2db0277 /src/nvim/testdir | |
| parent | dd935e147344d90d42710c144822259a6af6f090 (diff) | |
| download | rneovim-44a331c36b5af25e51b072e8e77c478c2540ff43.tar.gz rneovim-44a331c36b5af25e51b072e8e77c478c2540ff43.tar.bz2 rneovim-44a331c36b5af25e51b072e8e77c478c2540ff43.zip | |
vim-patch:8.2.2820: session file may divide by zero
Problem: Session file may divide by zero.
Solution: Avoid writing difide by zero. (closes vim/vim#8162)
https://github.com/vim/vim/commit/b6c2e9a010ebd7db586081957e634903d4972fa1
Avoid typecasts if possible.
Use PRIdLINENR, PRId64, to format line numbers.
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_mksession.vim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_mksession.vim b/src/nvim/testdir/test_mksession.vim index 7bb76ad9eb..d7cb4e743c 100644 --- a/src/nvim/testdir/test_mksession.vim +++ b/src/nvim/testdir/test_mksession.vim @@ -149,6 +149,21 @@ func Test_mksession_large_winheight() call delete('Xtest_mks_winheight.out') endfunc +func Test_mksession_zero_winheight() + set winminheight=0 + edit SomeFile + split + wincmd _ + mksession! Xtest_mks_zero + set winminheight& + " let text = readfile('Xtest_mks_zero')->join() + let text = join(readfile('Xtest_mks_zero')) + "call delete('Xtest_mks_zero') + close + " check there is no devide by zero + call assert_notmatch('/ 0[^0-9]', text) +endfunc + func Test_mksession_rtp() if has('win32') " TODO: fix problem with backslashes |