view src/testdir/test_exists_autocmd.vim @ 22427:58cdc5d7f143 v8.2.1762

patch 8.2.1762: when a timer uses :stopinsert completion isn't stopped Commit: https://github.com/vim/vim/commit/d0e1b7103c14eb0d175c6b245b4b6ed93a204da9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 27 20:13:03 2020 +0200 patch 8.2.1762: when a timer uses :stopinsert completion isn't stopped Problem: When a timer uses :stopinsert Insert mode completion isn't stopped. (Stanley Chan) Solution: Call ins_compl_prep(ESC).
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Sep 2020 20:15:03 +0200
parents 08940efa6b4e
children
line wrap: on
line source

" Test that groups and patterns are tested correctly when calling exists() for
" autocommands.

function Test_AutoCommands()
  let results=[]
  augroup auexists
  augroup END
  call assert_true(exists("##BufEnter"))
  call assert_false(exists("#BufEnter"))
  au BufEnter * let g:entered=1
  call assert_true(exists("#BufEnter"))
  call assert_false(exists("#auexists#BufEnter"))
  augroup auexists
  au BufEnter * let g:entered=1
  augroup END
  call assert_true(exists("#auexists#BufEnter"))
  call assert_false(exists("#BufEnter#*.test"))
  au BufEnter *.test let g:entered=1
  call assert_true(exists("#BufEnter#*.test"))
  edit testfile.test
  call assert_false(exists("#BufEnter#<buffer>"))
  au BufEnter <buffer> let g:entered=1
  call assert_true(exists("#BufEnter#<buffer>"))
  edit testfile2.test
  call assert_false(exists("#BufEnter#<buffer>"))
endfunction

" vim: shiftwidth=2 sts=2 expandtab