- Fixed s:indent_snippet().
This commit is contained in:
parent
2783eac03a
commit
26a8a75a7e
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
||||||
" Last Modified: 06 Nov 2012.
|
" Last Modified: 08 Nov 2012.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" a copy of this software and associated documentation files (the
|
||||||
@ -374,8 +374,13 @@ function! s:parse_snippets_file(snippets, snippets_file)"{{{
|
|||||||
\ line, linenr, dup_check)
|
\ line, linenr, dup_check)
|
||||||
elseif !empty(snippet_dict)
|
elseif !empty(snippet_dict)
|
||||||
if line =~ '^\s' || line == ''
|
if line =~ '^\s' || line == ''
|
||||||
|
if snippet_dict.word == ''
|
||||||
|
" Substitute head tab character.
|
||||||
|
let line = substitute(line, '^\t', '', '')
|
||||||
|
endif
|
||||||
|
|
||||||
let snippet_dict.word .=
|
let snippet_dict.word .=
|
||||||
\ substitute(line, '^\%(\t\| *\)', '', '') . "\n"
|
\ substitute(line, '^ *', '', '') . "\n"
|
||||||
else
|
else
|
||||||
call s:add_snippet_attribute(line, linenr, snippet_dict)
|
call s:add_snippet_attribute(line, linenr, snippet_dict)
|
||||||
endif
|
endif
|
||||||
@ -679,23 +684,19 @@ function! s:indent_snippet(begin, end)"{{{
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let equalprg = &l:equalprg
|
|
||||||
let pos = getpos('.')
|
let pos = getpos('.')
|
||||||
|
|
||||||
let neosnippet = neosnippet#get_current_neosnippet()
|
let neosnippet = neosnippet#get_current_neosnippet()
|
||||||
|
|
||||||
|
let equalprg = &l:equalprg
|
||||||
try
|
try
|
||||||
setlocal equalprg=
|
setlocal equalprg=
|
||||||
|
|
||||||
" Check use of indent plugin.
|
" Indent begin line?
|
||||||
if neosnippet.target == '' && getline(a:begin+1) !~ '^\t\+'
|
let begin = (neosnippet.target == '') ? a:begin : a:begin + 1
|
||||||
" Indent begin line.
|
|
||||||
call cursor(a:begin, 0)
|
|
||||||
silent normal! ==
|
|
||||||
endif
|
|
||||||
|
|
||||||
let base_indent = matchstr(getline(a:begin), '^\s\+')
|
let base_indent = matchstr(getline(a:begin), '^\s\+')
|
||||||
for line_nr in range(a:begin+1, a:end)
|
for line_nr in range(begin, a:end)
|
||||||
call cursor(line_nr, 0)
|
call cursor(line_nr, 0)
|
||||||
|
|
||||||
if getline('.') =~ '^\t\+'
|
if getline('.') =~ '^\t\+'
|
||||||
|
@ -712,6 +712,9 @@ A: Please try below settings. It defines snipMate function.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGELOG *neosnippet-changelog*
|
CHANGELOG *neosnippet-changelog*
|
||||||
|
|
||||||
|
2012-11-07
|
||||||
|
- Fixed s:indent_snippet().
|
||||||
|
|
||||||
2012-11-06
|
2012-11-06
|
||||||
- Improved default tex snippets.
|
- Improved default tex snippets.
|
||||||
- Fixed expand target.
|
- Fixed expand target.
|
||||||
|
Loading…
Reference in New Issue
Block a user