view src/testdir/test_fnameescape.vim @ 32224:e33c3437796a v9.0.1443

patch 9.0.1443: ending Insert mode when accessing a hidden prompt buffer Commit: https://github.com/vim/vim/commit/05a627c3d4e42a18f76c14828d68ee4747118211 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 9 22:01:31 2023 +0100 patch 9.0.1443: ending Insert mode when accessing a hidden prompt buffer Problem: Ending Insert mode when accessing a hidden prompt buffer. Solution: Don't stop Insert mode when it was active before. (closes https://github.com/vim/vim/issues/12237)
author Bram Moolenaar <Bram@vim.org>
date Sun, 09 Apr 2023 23:15:05 +0200
parents 08940efa6b4e
children
line wrap: on
line source

" Test if fnameescape is correct for special chars like !

func Test_fnameescape()
  let fname = 'Xspa ce'
  let status = v:false
  try
    exe "w! " . fnameescape(fname)
    let status = v:true
  endtry
  call assert_true(status, "Space")
  call delete(fname)

  let fname = 'Xemark!'
  let status = v:false
  try
    exe "w! " . fname->fnameescape()
    let status = v:true
  endtry
  call assert_true(status, "ExclamationMark")
  call delete(fname)

  call assert_equal('\-', fnameescape('-'))
  call assert_equal('\+', fnameescape('+'))
  call assert_equal('\>', fnameescape('>'))
endfunc

" vim: shiftwidth=2 sts=2 expandtab