- Improved indent snippet behavior.

This commit is contained in:
Shougo Matsushita 2012-10-06 16:22:36 +09:00
commit 88821a7d9b
3 changed files with 33 additions and 25 deletions

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: snippets_complete.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 04 Oct 2012.
" Last Modified: 06 Oct 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: neosnippet.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 04 Oct 2012.
" Last Modified: 06 Oct 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@ -568,9 +568,14 @@ function! neosnippet#expand(cur_text, col, trigger_name)"{{{
endfunction"}}}
function! s:indent_snippet(begin, end)"{{{
let equalprg = &l:equalprg
let pos = getpos('.')
try
setlocal equalprg=
let pos = getpos('.')
" Indent begin line.
call cursor(a:begin, 0)
silent normal! ==
let base_indent = matchstr(getline(a:begin), '^\s\+')
for line_nr in range(a:begin+1, a:end)
@ -592,10 +597,10 @@ function! s:indent_snippet(begin, end)"{{{
silent normal! ==
endif
endfor
call setpos('.', pos)
finally
let &l:equalprg = equalprg
call setpos('.', pos)
endtry
endfunction"}}}
function! s:get_snippet_range(begin_line, begin_patterns, end_line, end_patterns)"{{{

View File

@ -407,6 +407,9 @@ snippet *neosnippet-unite-action-snippet*
==============================================================================
CHANGELOG *neosnippet-changelog*
2012-10-06
- Improved indent snippet behavior.
2012-10-04
- Refactored snippets filter.
- Changed :NeoSnippetEdit behavior.