comparison src/testdir/test_mksession.vim @ 23812:84089558c5df v8.2.2447

patch 8.2.2447: 'foldlevel' not applied to folds restored from session Commit: https://github.com/vim/vim/commit/f9547eb6ef02e305203b859d2dcfdae930b9d544 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 1 19:24:55 2021 +0100 patch 8.2.2447: 'foldlevel' not applied to folds restored from session Problem: 'foldlevel' not applied to folds restored from session. Solution: Set 'foldlevel' after creaiting the folds. (closes https://github.com/vim/vim/issues/7767)
author Bram Moolenaar <Bram@vim.org>
date Mon, 01 Feb 2021 19:30:04 +0100
parents 855b818aae9b
children a2f13e56b0e7
comparison
equal deleted inserted replaced
23811:e68d84effb68 23812:84089558c5df
502 502
503 call StopShellInTerminal(term_buf) 503 call StopShellInTerminal(term_buf)
504 call delete('Xtestview') 504 call delete('Xtestview')
505 endfunc 505 endfunc
506 506
507 func Test_mkview_open_folds()
508 enew!
509
510 call append(0, ['a', 'b', 'c'])
511 1,3fold
512 " zR affects 'foldlevel', make sure the option is applied after the folds
513 " have been recreated.
514 normal zR
515 write! Xtestfile
516
517 call assert_equal(-1, foldclosed(1))
518 call assert_equal(-1, foldclosed(2))
519 call assert_equal(-1, foldclosed(3))
520
521 mkview! Xtestview
522 source Xtestview
523
524 call assert_equal(-1, foldclosed(1))
525 call assert_equal(-1, foldclosed(2))
526 call assert_equal(-1, foldclosed(3))
527
528 call delete('Xtestview')
529 call delete('Xtestfile')
530 %bwipe
531 endfunc
532
507 " Test :mkview with a file argument. 533 " Test :mkview with a file argument.
508 func Test_mkview_file() 534 func Test_mkview_file()
509 " Create a view with line number and a fold. 535 " Create a view with line number and a fold.
510 help :mkview 536 help :mkview
511 set number 537 set number