Mercurial > vim
view src/testdir/test_exists_autocmd.vim @ 20441:86dde5c4b375 v8.2.0775
patch 8.2.0775: not easy to call a Vim function from Lua
Commit: https://github.com/vim/vim/commit/eb04f0893afe01faff272ef84c70d8cc16d8e80a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 17 14:32:35 2020 +0200
patch 8.2.0775: not easy to call a Vim function from Lua
Problem: Not easy to call a Vim function from Lua.
Solution: Add vim.call() and vim.fn(). (Prabir Shrestha, closes https://github.com/vim/vim/issues/6063)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 May 2020 14:45:04 +0200 |
parents | 140d51d5b5c3 |
children | 08940efa6b4e |
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