diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2018-12-26 10:41:57 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2018-12-26 10:41:57 +0100 |
commit | d43b70d93987c94d15a352cf0026fb93d3317cc8 (patch) | |
tree | 74470b6cc30ddb4ef8ceb2ec557bc32ccccb5ebb /ftplugin/julia.vim | |
parent | ec1c94306953b678bb36572897bd218fe6c76506 (diff) | |
download | vim-polyglot-d43b70d93987c94d15a352cf0026fb93d3317cc8.tar.gz vim-polyglot-d43b70d93987c94d15a352cf0026fb93d3317cc8.zip |
Update
Diffstat (limited to 'ftplugin/julia.vim')
-rw-r--r-- | ftplugin/julia.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ftplugin/julia.vim b/ftplugin/julia.vim index caddabaf..bed55a8f 100644 --- a/ftplugin/julia.vim +++ b/ftplugin/julia.vim @@ -34,7 +34,10 @@ if exists("loaded_matchit") " note: begin_keywords must contain all blocks in order " for nested-structures-skipping to work properly let b:julia_begin_keywords = '\%(\%(\.\s*\)\@<!\|\%(@\s*.\s*\)\@<=\)\<\%(\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|\%(\(abstract\|primitive\)\s\+\)\@<!type\|immutable\|let\|do\|\%(bare\)\?module\|quote\|if\|for\|while\|try\)\>' - let s:macro_regex = '@\%(#\@!\S\)\+\s\+' + " note: the following regex not only recognizes macros, but also local/global keywords. + " the purpose is recognizing things like `@inline myfunction()` + " or `global myfunction(...)` etc, for matchit and block movement functionality + let s:macro_regex = '\%(@\%(#\@!\S\)\+\|\<\%(local\|global\)\)\s\+' let s:nomacro = '\%(' . s:macro_regex . '\)\@<!' let s:yesmacro = s:nomacro . '\%('. s:macro_regex . '\)\+' let b:julia_begin_keywordsm = '\%(' . s:yesmacro . b:julia_begin_keywords . '\)\|' @@ -46,7 +49,7 @@ if exists("loaded_matchit") let [l,c] = [line('.'),col('.')] let attr = synIDattr(synID(l, c, 1),"name") let c1 = c - while attr == 'juliaMacro' + while attr == 'juliaMacro' || expand('<cword>') =~# '\<\%(global\|local\)\>' normal! W if line('.') > l || col('.') == c1 call cursor(l, c) |