mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
Update runtime files
This commit is contained in:
@@ -20,7 +20,10 @@ endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\<def\>'
|
||||
let s:annotationMatcher = '@[A-Za-z._]\+\s\+'
|
||||
let s:modifierMatcher = s:annotationMatcher . '\|\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\|final\s\+'
|
||||
let s:defMatcher = '\%(' . s:modifierMatcher . '\)*\<def\>'
|
||||
let s:valMatcher = '\%(' . s:modifierMatcher . '\|lazy\s\+\)*\<va[lr]\>'
|
||||
let s:funcNameMatcher = '\w\+'
|
||||
let s:typeSpecMatcher = '\%(\s*\[\_[^\]]*\]\)'
|
||||
let s:defArgMatcher = '\%((\_.\{-})\)'
|
||||
@@ -184,7 +187,7 @@ function! scala#NumberOfBraceGroups(line)
|
||||
endfunction
|
||||
|
||||
function! scala#MatchesIncompleteDefValr(line)
|
||||
if a:line =~ '^\s*\%(' . s:defMatcher . '\|\<va[lr]\>\).*[=({]\s*$'
|
||||
if a:line =~ '^\s*\%(' . s:defMatcher . '\|' . s:valMatcher . '\).*[=({]\s*$'
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -434,7 +437,7 @@ function! GetScalaIndent()
|
||||
" If 'val', 'var', 'def' end with =, this is a one-line block
|
||||
if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
|
||||
\ || prevline =~ '^\s*' . s:defMatcher . '.*=\s*$'
|
||||
\ || prevline =~ '^\s*\<va[lr]\>.*[=]\s*$'
|
||||
\ || prevline =~ '^\s*' . s:valMatcher . '.*[=]\s*$'
|
||||
\ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
|
||||
\ || prevline =~ '=\s*$'
|
||||
call scala#ConditionalConfirm("4")
|
||||
|
Reference in New Issue
Block a user