From ba774c39ca953d5dabfffcd70bc710eda6ac768e Mon Sep 17 00:00:00 2001 From: Stanislav Seletskiy Date: Tue, 16 Jun 2015 11:21:38 +0600 Subject: [PATCH] review fixes --- doc/UltiSnips.txt | 4 ++++ pythonx/UltiSnips/buffer_proxy.py | 3 ++- test/vim_test_case.py | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index dee9199..b4a58ee 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -1443,11 +1443,15 @@ Specified code will be evaluated at stages defined above and same global variables and modules will be available that are stated in the *UltiSnips-context-snippets* section. + *UltiSnips-buffer-proxy* + Note: special variable called 'snip.buffer' should be used for all buffer modifications. Not 'vim.current.buffer' and not 'vim.command("...")', because of in that case UltiSnips will not be able to track changes buffer from actions. +'snip.buffer' has the same interface as 'vim.current.window.buffer'. + 4.10.1 Pre-expand actions *UltiSnips-pre-expand-actions* Pre-expand actions can be used to match snippet in one location and then diff --git a/pythonx/UltiSnips/buffer_proxy.py b/pythonx/UltiSnips/buffer_proxy.py index 312f258..b0db32d 100644 --- a/pythonx/UltiSnips/buffer_proxy.py +++ b/pythonx/UltiSnips/buffer_proxy.py @@ -85,7 +85,8 @@ class VimBufferProxy(_vim.VimBuffer): raise RuntimeError('buffer was modified using vim.command or ' + 'vim.current.buffer; that changes are untrackable and leads to ' + 'errors in snippet expansion; use special variable `snip.buffer` ' - 'for buffer modifications') + 'for buffer modifications.\n\n' + + 'See :help UltiSnips-buffer-proxy for more info.') def __setitem__(self, key, value): """ diff --git a/test/vim_test_case.py b/test/vim_test_case.py index 6caa78b..f3a6e08 100644 --- a/test/vim_test_case.py +++ b/test/vim_test_case.py @@ -128,7 +128,6 @@ class VimTestCase(unittest.TestCase, TempFileManager): vim_config.append('set fileencoding=utf-8') vim_config.append('set buftype=nofile') vim_config.append('set shortmess=at') - vim_config.append('set cmdheight=10') vim_config.append('let @" = ""') assert EX == "\t" # Otherwise you need to change the next line vim_config.append('let g:UltiSnipsExpandTrigger=""')