view src/testdir/test_scroll_opt.vim @ 22357:0e231e8e70f8 v8.2.1727

patch 8.2.1727: a popup created with "cursorline" will ignore "firstline" Commit: https://github.com/vim/vim/commit/99ca9c4868bb1669706b9e3de9a9218bd11cc459 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 22 21:55:41 2020 +0200 patch 8.2.1727: a popup created with "cursorline" will ignore "firstline" Problem: A popup created with "cursorline" will ignore "firstline". Solution: When both "cursorline" and "firstline" are present put the cursor on "firstline". (closes #7000) Add the "winid" argument to getcurpos().
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Sep 2020 22:00:03 +0200
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