view src/testdir/test_scroll_opt.vim @ 17678:723ec38d521e v8.1.1836

patch 8.1.1836: inaccurate memory estimate for Amiga-like OS commit https://github.com/vim/vim/commit/a9ab391a3a5283754ef216daacbaac446f1f9077 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 10 14:54:20 2019 +0200 patch 8.1.1836: inaccurate memory estimate for Amiga-like OS Problem: Inaccurate memory estimate for Amiga-like OS. Solution: Adjust #ifdef for AvailMem(). (Ola S?der, closes https://github.com/vim/vim/issues/4797)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Aug 2019 15:00:06 +0200
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