From a8c9caae81ebab19ac75919d24a48a769e8e6ebc Mon Sep 17 00:00:00 2001 From: tafryn Date: Fri, 8 Aug 2014 16:27:38 -0700 Subject: [PATCH 1/4] Add check to prevent errors when using vimpager. --- ftdetect/UltiSnips.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ftdetect/UltiSnips.vim b/ftdetect/UltiSnips.vim index e5df595..48844c6 100644 --- a/ftdetect/UltiSnips.vim +++ b/ftdetect/UltiSnips.vim @@ -1,8 +1,10 @@ " This has to be called before ftplugins are loaded. Therefore " it is here in ftdetect though it maybe shouldn't -if has("autocmd") - augroup UltiSnipsFileType - au! - autocmd FileType * call UltiSnips#FileTypeChanged() - augroup END +if !exists("vimpager") + if has("autocmd") + augroup UltiSnipsFileType + au! + autocmd FileType * call UltiSnips#FileTypeChanged() + augroup END + endif endif From f6e33387a27862c10b514c82eaf616e18f5909fd Mon Sep 17 00:00:00 2001 From: tafryn Date: Mon, 1 Sep 2014 00:45:20 -0700 Subject: [PATCH 2/4] Clean-up vimpager check. --- ftdetect/UltiSnips.vim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ftdetect/UltiSnips.vim b/ftdetect/UltiSnips.vim index 48844c6..0cabb07 100644 --- a/ftdetect/UltiSnips.vim +++ b/ftdetect/UltiSnips.vim @@ -1,10 +1,14 @@ " This has to be called before ftplugins are loaded. Therefore " it is here in ftdetect though it maybe shouldn't -if !exists("vimpager") - if has("autocmd") + +" This is necessary to prevent errors when using vim as a pager. +if exists("vimpager") + finish +endif + +if has("autocmd") augroup UltiSnipsFileType au! autocmd FileType * call UltiSnips#FileTypeChanged() augroup END - endif -endif +endif \ No newline at end of file From 9c632378a5c2a6a5d7fe1c6711d4d1cdd81bc98c Mon Sep 17 00:00:00 2001 From: tafryn Date: Tue, 2 Sep 2014 07:32:06 -0700 Subject: [PATCH 3/4] Add missing newline to ftdetect. --- ftdetect/UltiSnips.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftdetect/UltiSnips.vim b/ftdetect/UltiSnips.vim index 0cabb07..b3608d3 100644 --- a/ftdetect/UltiSnips.vim +++ b/ftdetect/UltiSnips.vim @@ -11,4 +11,4 @@ if has("autocmd") au! autocmd FileType * call UltiSnips#FileTypeChanged() augroup END -endif \ No newline at end of file +endif From cae25e5330830f2b7fa6903a991738ae0512c9cc Mon Sep 17 00:00:00 2001 From: tafryn Date: Wed, 3 Sep 2014 07:58:13 -0700 Subject: [PATCH 4/4] Change indent level to 3(?!) spaces. --- ftdetect/UltiSnips.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ftdetect/UltiSnips.vim b/ftdetect/UltiSnips.vim index b3608d3..f4a027f 100644 --- a/ftdetect/UltiSnips.vim +++ b/ftdetect/UltiSnips.vim @@ -7,8 +7,8 @@ if exists("vimpager") endif if has("autocmd") - augroup UltiSnipsFileType - au! - autocmd FileType * call UltiSnips#FileTypeChanged() - augroup END + augroup UltiSnipsFileType + au! + autocmd FileType * call UltiSnips#FileTypeChanged() + augroup END endif