view src/testdir/test_scroll_opt.vim @ 15195:16b2f2db6f28 v8.1.0607

patch 8.1.0607: proto files are not in sync with the source code commit https://github.com/vim/vim/commit/c447d8d33f695a83fefe4e47334b41c32874c3c5 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 18 21:56:28 2018 +0100 patch 8.1.0607: proto files are not in sync with the source code Problem: Proto files are not in sync with the source code. Solution: Update the proto files.
author Bram Moolenaar <Bram@vim.org>
date Tue, 18 Dec 2018 22:00:07 +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