view src/testdir/test_erasebackword.vim @ 14677:7771a1ff8b99 v8.1.0351

patch 8.1.0351: 'incsearch' for :/foo/s//<Esc> changes last search pattern commit https://github.com/vim/vim/commit/198cb66d652d3d8ac16226dcc929a11b0b720151 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 6 21:44:17 2018 +0200 patch 8.1.0351: 'incsearch' for :/foo/s//<Esc> changes last search pattern Problem: 'incsearch' for :/foo/s//<Esc> changes last search pattern. Solution: Save the last search pattern earlier.
author Christian Brabandt <cb@256bit.org>
date Thu, 06 Sep 2018 21:45:05 +0200
parents 90aaa974594e
children 2dcaa860e3fc
line wrap: on
line source


func Test_erasebackword()
  if !has('multi_byte')
    return
  endif

  set encoding=utf-8
  enew

  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>"
  call assert_equal(' wwwこんにちわ世界ワールド', getline('.'))
  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>"
  call assert_equal(' wwwこんにちわ世界', getline('.'))
  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>\<C-W>"
  call assert_equal(' wwwこんにちわ', getline('.'))
  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>\<C-W>\<C-W>"
  call assert_equal(' www', getline('.'))
  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>\<C-W>\<C-W>\<C-W>"
  call assert_equal(' ', getline('.'))
  exe "normal o wwwこんにちわ世界ワールドvim \<C-W>\<C-W>\<C-W>\<C-W>\<C-W>\<C-W>"
  call assert_equal('', getline('.'))

  enew!
  set encoding&
endfunc