view src/testdir/test_scroll_opt.vim @ 25242:1ef6880ba4a9 v8.2.3157

patch 8.2.3157: crypt test may fail on MS-Windows Commit: https://github.com/vim/vim/commit/16e26a31161d65baca7885c46c43ab4a48399c92 Author: Christian Brabandt <cb@256bit.org> Date: Tue Jul 13 19:09:12 2021 +0200 patch 8.2.3157: crypt test may fail on MS-Windows Problem: Crypt test may fail on MS-Windows. Solution: Ignore "[unix]" in the file message. (Christian Brabandt, closes #8561)
author Bram Moolenaar <Bram@vim.org>
date Tue, 13 Jul 2021 19:15:04 +0200
parents 08940efa6b4e
children 6c6ac189a05f
line wrap: on
line source

" Test for reset 'scroll'

func Test_reset_scroll()
  let scr = &l:scroll

  setlocal scroll=1
  setlocal scroll&
  call assert_equal(scr, &l:scroll)

  setlocal scroll=1
  setlocal scroll=0
  call assert_equal(scr, &l:scroll)

  try
    execute 'setlocal scroll=' . (winheight(0) + 1)
    " not reached
    call assert_false(1)
  catch
    call assert_exception('E49:')
  endtry

  split

  let scr = &l:scroll

  setlocal scroll=1
  setlocal scroll&
  call assert_equal(scr, &l:scroll)

  setlocal scroll=1
  setlocal scroll=0
  call assert_equal(scr, &l:scroll)

  quit!
endfunc

" vim: shiftwidth=2 sts=2 expandtab