From 104e571c4a8319012f6032c2ce6fc3d2d628fdd6 Mon Sep 17 00:00:00 2001 From: Tommy Allen Date: Thu, 4 Aug 2016 00:09:57 -0400 Subject: [PATCH] Allow file type to be passed into UltiSnips#FileTypeChanged() --- autoload/UltiSnips.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/UltiSnips.vim b/autoload/UltiSnips.vim index 6000ff0..056f572 100644 --- a/autoload/UltiSnips.vim +++ b/autoload/UltiSnips.vim @@ -3,7 +3,7 @@ if exists("b:did_autoload_ultisnips") || !exists("g:_uspy") " TODO(sirver): Add a test for that using a bad g:UltiSnipsPythonVersion " setting. Without this fix moving the cursor will spam errors, with this " it should not. - function! UltiSnips#FileTypeChanged() + function! UltiSnips#FileTypeChanged(...) endfunction finish @@ -116,9 +116,9 @@ function! UltiSnips#JumpForwards() return "" endfunction -function! UltiSnips#FileTypeChanged() +function! UltiSnips#FileTypeChanged(...) exec g:_uspy "UltiSnips_Manager.reset_buffer_filetypes()" - exec g:_uspy "UltiSnips_Manager.add_buffer_filetypes('" . &ft . "')" + exec g:_uspy "UltiSnips_Manager.add_buffer_filetypes('" . (a:0 ? a:1 : &ft) . "')" return "" endfunction