- Improved changing foldmethod feature.

This commit is contained in:
Shougo Matsushita 2013-04-16 11:18:35 +09:00
parent 2b835d3af7
commit 88910d3728
2 changed files with 15 additions and 2 deletions

View File

@ -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: 12 Apr 2013. " Last Modified: 16 Apr 2013.
" 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
@ -581,6 +581,13 @@ function! neosnippet#expand(cur_text, col, trigger_name) "{{{
let next_col = len(snippet_lines[-1]) + 1 let next_col = len(snippet_lines[-1]) + 1
let snippet_lines[-1] = snippet_lines[-1] . next_line let snippet_lines[-1] = snippet_lines[-1] . next_line
if has('folding')
" Note: Change foldmethod to "manual". Because, if you use foldmethod is
" expr, whole snippet is visually selected.
let foldmethod_save = &l:foldmethod
let &l:foldmethod = 'manual'
endif
try try
call setline('.', snippet_lines[0]) call setline('.', snippet_lines[0])
if len(snippet_lines) > 1 if len(snippet_lines) > 1
@ -608,6 +615,10 @@ function! neosnippet#expand(cur_text, col, trigger_name) "{{{
endif endif
finally finally
if has('folding') if has('folding')
if foldmethod_save !=# &l:foldmethod
let &l:foldmethod = foldmethod_save
endif
silent! execute begin_line . ',' . end_line . 'foldopen!' silent! execute begin_line . ',' . end_line . 'foldopen!'
endif endif
endtry endtry

View File

@ -772,8 +772,10 @@ A:
============================================================================== ==============================================================================
CHANGELOG *neosnippet-changelog* CHANGELOG *neosnippet-changelog*
2013-04-16
- Improved changing foldmethod feature.
2013-04-12 2013-04-12
- Removed changing foldmethod feature.
- Fixed syntax file. - Fixed syntax file.
2013-04-11 2013-04-11