From 24db4b3c7f4d81c983e942e7392b6b3bdd8184ff Mon Sep 17 00:00:00 2001 From: h-youhei Date: Mon, 13 Mar 2017 03:06:16 +0900 Subject: [PATCH] for snippets that contain linebreak --- indent/neosnippet.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indent/neosnippet.vim b/indent/neosnippet.vim index 43e8fbf..87f953b 100644 --- a/indent/neosnippet.vim +++ b/indent/neosnippet.vim @@ -40,7 +40,7 @@ endif setlocal autoindent setlocal indentexpr=SnippetsIndent() -setlocal indentkeys=o,O,=abbr\ ,=prev_word\ ,=alias\ ,=options\ ,=regexp\ ,!^F +setlocal indentkeys=o,O,=include\ ,=snippet\ ,=abbr\ ,=prev_word\ ,=delete\ ,=alias\ ,=options\ ,=regexp\ ,!^F let b:undo_indent .= 'setlocal \ autoindent< @@ -56,9 +56,7 @@ function! SnippetsIndent() abort "{{{ "for indentkeys o,O if s:is_empty(line) - if s:is_empty(prev_line) - return 0 - elseif prev_line =~ '^' . defining + if prev_line =~ '^' . defining return shiftwidth() else return -1 @@ -67,6 +65,8 @@ function! SnippetsIndent() abort "{{{ "for indentkeys =words else if line =~ '^\s*' . syntax + \ && (s:is_empty(prev_line) + \ || prev_line =~ '^' . defining) return 0 else return -1