view src/testdir/test_feedkeys.vim @ 28061:050d49de7a66 v8.2.4555

patch 8.2.4555: getmousepos() returns the wrong column Commit: https://github.com/vim/vim/commit/986b0fd0c550d9834a3cc45dd87555c13152c391 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 13 12:06:07 2022 +0000 patch 8.2.4555: getmousepos() returns the wrong column Problem: getmousepos() returns the wrong column. (Ernie Rael) Solution: Limit to the text size, not the number of bytes.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Mar 2022 13:15:04 +0100
parents e06cbcf4b94b
children 53c608c7ea9e
line wrap: on
line source

" Test feedkeys() function.

func Test_feedkeys_x_with_empty_string()
  new
  call feedkeys("ifoo\<Esc>")
  call assert_equal('', getline('.'))
  call feedkeys('', 'x')
  call assert_equal('foo', getline('.'))

  " check it goes back to normal mode immediately.
  call feedkeys('i', 'x')
  call assert_equal('foo', getline('.'))
  quit!
endfunc

func Test_feedkeys_with_abbreviation()
  new
  inoreabbrev trigger value
  call feedkeys("atrigger ", 'x')
  call feedkeys("atrigger ", 'x')
  call assert_equal('value value ', getline(1))
  bwipe!
  iunabbrev trigger
endfunc

" vim: shiftwidth=2 sts=2 expandtab