view src/testdir/test_scroll_opt.vim @ 23907:c8aa6d26e6e1 v8.2.2496

patch 8.2.2496: insufficien testing for text jumping fix Commit: https://github.com/vim/vim/commit/5202929dab58402a5f3cd9c231e09abb5c451c56 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 10 21:20:30 2021 +0100 patch 8.2.2496: insufficien testing for text jumping fix Problem: Insufficien testing for text jumping fix. Solution: Add another test case.
author Bram Moolenaar <Bram@vim.org>
date Wed, 10 Feb 2021 21:30:04 +0100
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