diff --git a/indent/vbnet.vim b/indent/vbnet.vim index d83cff3..3e88cb1 100644 --- a/indent/vbnet.vim +++ b/indent/vbnet.vim @@ -1,7 +1,7 @@ " Vim indent file " Language : VisualBasic.NET -" Maintainers: OGURA Daiki -" Last Change: 2013-01-25 +" Maintainers: OGURA Daiki, MATSUSHIMA Kazuhiro +" Last Change: 2017-12-27 if exists("b:did_indent") finish @@ -45,15 +45,14 @@ function VbNetGetIndent(lnum) if previous_line =~? 'Then$' return ind + &l:shiftwidth - elseif previous_line =~? '^\s*\<\(Select Case\|Else\|ElseIf\|For\|While\|Using\|Try\|Catch\|Finally\)\>' + elseif previous_line =~? '^\s*\<\(Select Case\|Else\|ElseIf\|For\|While\|Using\|With\|Try\|Catch\|Finally\)\>' return ind + &l:shiftwidth elseif previous_line =~? '^\s\+}$' return &l:shiftwidth + &l:shiftwidth endif - if previous_line =~? 'End \(If\|Case\|Try\|Sub\|Function\|Class\|Operator\)$' + if previous_line =~? 'End \(If\|Case\|While\|Using\|With\|Try\|Sub\|Function\|Class\|Operator\)$' return ind - endif " labels and preprocessor get zero indent immediately diff --git a/syntax/vbnet.vim b/syntax/vbnet.vim index a18eb48..f92c590 100644 --- a/syntax/vbnet.vim +++ b/syntax/vbnet.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language : VisualBasic.NET -" Maintainers: OGURA Daiki -" Last Change: 2013-01-25 +" Maintainers: OGURA Daiki, MATSUSHIMA Kazuhiro +" Last Change: 2017-12-29 if version < 600 syntax clear @@ -57,15 +57,17 @@ syn match vbnetDefAnonymousTypedef "=\s\ \(With$\|With {$\)" syn keyword vbnetProperty Property Get Set syn match vbnetPropertyEnd "^\s*End \(Get\|Set\|Property\)$" -syn keyword vbnetKeyword ByVal GetType ParamArray On Option Optional Exit Imports +syn keyword vbnetKeyword ByVal ByRef GetType ParamArray On Option Optional Exit Imports syn keyword vbnetException Try Catch Finally Throw syn match vbnetException "\ Try$" -syn match vbnetUsing Using +syn keyword vbnetUsing Using syn match vbnetUsing "\ Using$" +syn keyword vbnetWith With +syn match vbnetWith "\ With$" syn keyword vbnetOperator New And Or AndAlso OrElse Is Not IsNot Like Mod syn keyword vbnetBoolean True False syn match vbnetDelimiter "\(,\|\.\|:\|{\|}\|\s_$\)" -syn keyword vbnetDeprecated Do Until Loop Goto Redim GoSub Resume Erase Preserve IIF ByRef +syn keyword vbnetDeprecated Do Until Loop Goto Redim GoSub Resume Erase Preserve IIF Call "}}} syn keyword vbnetConst MyBase MyClass Me Nothing @@ -133,6 +135,7 @@ if version >= 508 || !exists("did_vbnet") hi link vbnetKeyword Keyword hi link vbnetException Exception hi link vbnetUsing Exception + hi link vbnetWith Conditional hi link vbnetAttribute PreProc hi link vbnetStorage StorageClass hi link vbnetModifier vbnetStorage