view src/testdir/test_ex_undo.vim @ 34815:8e38ceda0822 v9.1.0280

patch 9.1.0280: several issues with 'smoothscroll' support Commit: https://github.com/vim/vim/commit/9148ba8a46baa3934c44164989cdcdec5d01d9e3 Author: Luuk van Baal <luukvbaal@gmail.com> Date: Mon Apr 8 22:27:41 2024 +0200 patch 9.1.0280: several issues with 'smoothscroll' support Problem: Logic to make sure cursor is in visible part of the screen after scrolling the text with 'smoothscroll' is scattered, asymmetric and contains bugs. Solution: Adjust and create helper function for 'smoothscroll' cursor logic. (Luuk van Baal) closes: #14410 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 08 Apr 2024 22:45:03 +0200
parents 08940efa6b4e
children
line wrap: on
line source

" Tests for :undo

func Test_ex_undo()
  new ex-undo
  setlocal ul=10
  exe "normal ione\n\<Esc>"
  setlocal ul=10
  exe "normal itwo\n\<Esc>"
  setlocal ul=10
  exe "normal ithree\n\<Esc>"
  call assert_equal(4, line('$'))
  undo
  call assert_equal(3, line('$'))
  undo 1
  call assert_equal(2, line('$'))
  undo 0
  call assert_equal(1, line('$'))
  quit!
endfunc

" vim: shiftwidth=2 sts=2 expandtab