view src/testdir/test_scroll_opt.vim @ 21164:4a190861f0cc v8.2.1133

patch 8.2.1133: Vim9: return type of add() is not specific enough Commit: https://github.com/vim/vim/commit/fce82b3aa7dd87f9e15a4c12eda2c65de285d99a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 5 16:07:21 2020 +0200 patch 8.2.1133: Vim9: return type of add() is not specific enough Problem: Vim9: return type of add() is not specific enough. Solution: Return the type of the first argument. (closes https://github.com/vim/vim/issues/6395)
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jul 2020 16:15:04 +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