From 3237960a758c2b215d1cba43d1978c508db1283f Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 29 Dec 2011 21:05:19 +0100 Subject: [PATCH] Move python online commands into vim functions for better profiling --- plugin/UltiSnips.vim | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/plugin/UltiSnips.vim b/plugin/UltiSnips.vim index bd7f464..562052a 100644 --- a/plugin/UltiSnips.vim +++ b/plugin/UltiSnips.vim @@ -170,6 +170,16 @@ function! UltiSnips_MapKeys() " Do not remap this. snoremap :py UltiSnips_Manager.backspace_while_selected() endf + +function! UltiSnips_CursorMoved() + py UltiSnips_Manager.cursor_moved() +endf +function! UltiSnips_EnteredInsertMode() + py UltiSnips_Manager.entered_insert_mode() +endf +function! UltiSnips_LeavingWindow() + py UltiSnips_Manager.leaving_window() +endf " }}} "" STARTUP CODE {{{ @@ -187,9 +197,9 @@ UltiSnips_Manager.forward_trigger = vim.eval("g:UltiSnipsJumpForwardTrigger") UltiSnips_Manager.backward_trigger = vim.eval("g:UltiSnipsJumpBackwardTrigger") EOF -au CursorMovedI * py UltiSnips_Manager.cursor_moved() -au InsertEnter * py UltiSnips_Manager.entered_insert_mode() -au WinLeave * py UltiSnips_Manager.leaving_window() +au CursorMovedI * call UltiSnips_CursorMoved() +au InsertEnter * call UltiSnips_EnteredInsertMode() +au WinLeave * call UltiSnips_LeavingWindow() call UltiSnips_MapKeys()