From d402391f0868462220706c3ae4e70b59a7d3278a Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Tue, 21 May 2013 14:24:20 +0900 Subject: [PATCH] - Improved neosnippet initialization. --- autoload/neosnippet.vim | 21 +++++---------------- doc/neosnippet.txt | 3 +++ plugin/neosnippet.vim | 5 ++--- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index 675fcd0..1793c0d 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 16 Apr 2013. +" Last Modified: 21 May 2013. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -47,21 +47,10 @@ let s:neosnippet_options = [ \] "}}} -function! neosnippet#_lazy_initialize() "{{{ - if !exists('s:lazy_progress') - let s:lazy_progress = 0 - endif - - if s:lazy_progress == 0 - elseif s:lazy_progress == 1 - call s:initialize_script_variables() - elseif s:lazy_progress == 2 - call s:initialize_others() - else - call s:initialize_cache() - endif - - let s:lazy_progress += 1 +function! neosnippet#initialize() "{{{ + call s:initialize_script_variables() + call s:initialize_others() + call s:initialize_cache() endfunction"}}} function! s:check_initialize() "{{{ diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 60b295e..4b13569 100755 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -784,6 +784,9 @@ A: You can use |:NeoSnippetSource| for it. ============================================================================== CHANGELOG *neosnippet-changelog* +2013-05-21 +- Improved neosnippet initialization. + 2013-05-18 - Added go snippets. diff --git a/plugin/neosnippet.vim b/plugin/neosnippet.vim index cd1c402..d50a3a1 100644 --- a/plugin/neosnippet.vim +++ b/plugin/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 20 Jan 2013. +" Last Modified: 21 May 2013. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -89,8 +89,7 @@ inoremap (neosnippet_start_unite_snippet) "}}} augroup neosnippet "{{{ - autocmd CursorHold,CursorMovedI - \ * call neosnippet#_lazy_initialize() + autocmd InsertEnter * call neosnippet#initialize() augroup END"}}} " Commands. "{{{