From 254a89d67cac6c0cc39379f639ac0c221abd6e16 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Thu, 15 Jan 2015 11:21:09 -0500 Subject: [PATCH] Call s:setup() directly in the plugin. Should fix #202. - Move 'call s:setup()' out of the autocmd. - Add a test for the first buffer without filetype set. --- plugin/delimitMate.vim | 5 +++-- test/first_buffer_no_ft.vim | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test/first_buffer_no_ft.vim diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index 732238e..f330efb 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -384,8 +384,6 @@ augroup delimitMate " Run on file type change. au FileType * call setup() - au VimEnter * call setup() - " Run on new buffers. au BufNewFile,BufRead,BufEnter * \ if !exists('b:delimitMate_was_here') | @@ -396,6 +394,9 @@ augroup END "}}} +" This is for the default buffer when it does not have a filetype. +call s:setup() + let &cpo = save_cpo " GetLatestVimScripts: 2754 1 :AutoInstall: delimitMate.vim " vim:foldmethod=marker:foldcolumn=4:ts=2:sw=2 diff --git a/test/first_buffer_no_ft.vim b/test/first_buffer_no_ft.vim new file mode 100644 index 0000000..dc5225c --- /dev/null +++ b/test/first_buffer_no_ft.vim @@ -0,0 +1,8 @@ +let g:delimitMate_expand_cr = 1 +let g:delimitMate_eol_marker = ';' +call vimtest#StartTap() +call vimtap#Plan(1) +call vimtap#Like(maparg('(', 'i'), 'delimitMate(', 'Mappings defined for the first buffer without filetype set.') +call vimtest#Quit() + +