view src/testdir/test_scroll_opt.vim @ 15567:c9230ee2b1ad v8.1.0791

patch 8.1.0791: a few compiler warnings on VMS commit https://github.com/vim/vim/commit/563bbeabcce5580e03648e687bd7ddb9626a03d9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 22 21:45:40 2019 +0100 patch 8.1.0791: a few compiler warnings on VMS Problem: A few compiler warnings on VMS. Solution: Remove type cast. Adjust #ifdef. (Zoltan Arpadffy)
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Jan 2019 22:00:05 +0100
parents f8f505ffc0a6
children 08940efa6b4e
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