From 27d2e1b84548544576dd04d22de54956bbdb404d Mon Sep 17 00:00:00 2001 From: Gianmaria Bajo Date: Thu, 7 Mar 2024 09:45:52 +0100 Subject: [PATCH] Also check on BufEnter And move the autocommand into the autoload file. --- autoload/UltiSnips.vim | 3 +++ plugin/UltiSnips.vim | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/UltiSnips.vim b/autoload/UltiSnips.vim index 89f25123..712a4eb4 100644 --- a/autoload/UltiSnips.vim +++ b/autoload/UltiSnips.vim @@ -3,6 +3,9 @@ if exists("b:did_autoload_ultisnips") endif let b:did_autoload_ultisnips = 1 +" Ensure snippets are loaded for current buffer +au UltiSnips_AutoTrigger FileType,BufEnter * call UltiSnips#CheckFiletype() + " Also import vim as we expect it to be imported in many places. py3 import vim py3 from UltiSnips import UltiSnips_Manager diff --git a/plugin/UltiSnips.vim b/plugin/UltiSnips.vim index f718e961..3cdcb5e4 100644 --- a/plugin/UltiSnips.vim +++ b/plugin/UltiSnips.vim @@ -41,7 +41,6 @@ augroup UltiSnips_AutoTrigger if exists('##TextChangedP') au TextChangedP * call UltiSnips#TrackChange() endif - au FileType * call UltiSnips#CheckFiletype() augroup END call UltiSnips#map_keys#MapKeys()