summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-07-28 17:54:35 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2021-07-28 17:54:35 +0200
commitce31cd1d2f4e8eee9fd91325e4599f15cb9566fd (patch)
tree2306b79bdae6846233214734753be86ca6a13d7f
parent554a6ac7575f87b5b85d1b2bf60e7071c4164cbc (diff)
downloadvim-polyglot-ce31cd1d2f4e8eee9fd91325e4599f15cb9566fd.tar.gz
vim-polyglot-ce31cd1d2f4e8eee9fd91325e4599f15cb9566fd.zip
Update
-rw-r--r--after/syntax/c.vim4
-rw-r--r--autoload/fsharp.vim171
-rw-r--r--autoload/puppet/align.vim4
-rw-r--r--autoload/puppet/ctags.vim10
-rw-r--r--compiler/puppet-lint.vim6
-rw-r--r--ftplugin/epuppet.vim24
-rw-r--r--ftplugin/puppet.vim6
-rw-r--r--ftplugin/puppet_tagbar.vim2
-rw-r--r--ftplugin/terraform.vim3
-rw-r--r--indent/puppet.vim16
-rw-r--r--indent/ruby.vim36
-rw-r--r--syntax/ansible.vim2
-rw-r--r--syntax/basic/members.vim2
-rw-r--r--syntax/epuppet.vim4
-rw-r--r--syntax/git.vim2
-rw-r--r--syntax/puppet.vim4
16 files changed, 209 insertions, 87 deletions
diff --git a/after/syntax/c.vim b/after/syntax/c.vim
index a5daa792..0196b3d4 100644
--- a/after/syntax/c.vim
+++ b/after/syntax/c.vim
@@ -8,7 +8,7 @@ endif
" Original Author: Mikhail Wolfson <mywolfson@gmail.com>
" Maintainer: bfrg <https://github.com/bfrg>
" Website: https://github.com/bfrg/vim-cpp-modern
-" Last Change: Nov 23, 2020
+" Last Change: Jul 24, 2021
"
" This syntax file is based on:
" https://github.com/octol/vim-cpp-enhanced-highlight
@@ -20,7 +20,7 @@ syn keyword cTodo contained BUG NOTE
" Highlight function names
-if !get(g:, 'cpp_no_function_highlight', 0)
+if get(g:, 'cpp_function_highlight', 1)
syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cParen,cCppParen
hi def link cUserFunction Function
endif
diff --git a/autoload/fsharp.vim b/autoload/fsharp.vim
index 67f56495..8567a037 100644
--- a/autoload/fsharp.vim
+++ b/autoload/fsharp.vim
@@ -12,6 +12,15 @@ let g:loaded_autoload_fsharp = 1
let s:cpo_save = &cpo
set cpo&vim
+
+" basic setups
+
+let s:script_root_dir = expand('<sfile>:p:h') . "/../"
+
+if has('nvim-0.5')
+ lua ionide = require("ionide")
+endif
+
function! s:prompt(msg)
let height = &cmdheight
if height < 2
@@ -21,6 +30,9 @@ function! s:prompt(msg)
let &cmdheight = height
endfunction
+
+" FSAC payload interfaces
+
function! s:PlainNotification(content)
return { 'Content': a:content }
endfunction
@@ -80,8 +92,24 @@ function! s:FsdnRequest(query)
return { 'Query': a:query }
endfunction
+
+" LSP functions
+
function! s:call(method, params, cont)
- call LanguageClient#Call(a:method, a:params, a:cont)
+ if g:fsharp#backend == 'languageclient-neovim'
+ call LanguageClient#Call(a:method, a:params, a:cont)
+ elseif g:fsharp#backend == 'nvim'
+ let key = fsharp#register_callback(a:cont)
+ call luaeval('ionide.call(_A[1], _A[2], _A[3])', [a:method, a:params, key])
+ endif
+endfunction
+
+function! s:notify(method, params)
+ if g:fsharp#backend == 'languageclient-neovim'
+ call LanguageClient#Notify(a:method, a:params)
+ elseif g:fsharp#backend == 'nvim'
+ call luaeval('ionide.notify(_A[1], _A[2])', [a:method, a:params])
+ endif
endfunction
function! s:signature(filePath, line, character, cont)
@@ -121,6 +149,9 @@ function! s:documentationSymbol(xmlSig, assembly, cont)
return s:call('fsharp/documentationSymbol', s:DocumentationForSymbolRequest(a:xmlSig, a:assembly), a:cont)
endfunction
+
+" FSAC configuration
+
" FSharpConfigDto from https://github.com/fsharp/FsAutoComplete/blob/master/src/FsAutoComplete/LspHelpers.fs
"
" * The following options seems not working with workspace/didChangeConfiguration
@@ -160,7 +191,7 @@ let s:config_keys_camel =
\ ]
let s:config_keys = []
-function! fsharp#toSnakeCase(str)
+function! s:toSnakeCase(str)
let sn = substitute(a:str, '\(\<\u\l\+\|\l\+\)\(\u\)', '\l\1_\l\2', 'g')
if sn == a:str | return tolower(a:str) | endif
return sn
@@ -170,7 +201,7 @@ function! s:buildConfigKeys()
if len(s:config_keys) == 0
for key_camel in s:config_keys_camel
let key = {}
- let key.snake = fsharp#toSnakeCase(key_camel.key)
+ let key.snake = s:toSnakeCase(key_camel.key)
let key.camel = key_camel.key
if has_key(key_camel, 'default')
let key.default = key_camel.default
@@ -180,7 +211,7 @@ function! s:buildConfigKeys()
endif
endfunction
-function! g:fsharp#getServerConfig()
+function! fsharp#getServerConfig()
let fsharp = {}
call s:buildConfigKeys()
for key in s:config_keys
@@ -196,12 +227,76 @@ function! g:fsharp#getServerConfig()
return fsharp
endfunction
-function! g:fsharp#updateServerConfig()
+function! fsharp#updateServerConfig()
let fsharp = fsharp#getServerConfig()
let settings = {'settings': {'FSharp': fsharp}}
- call LanguageClient#Notify('workspace/didChangeConfiguration', settings)
+ call s:notify('workspace/didChangeConfiguration', settings)
+endfunction
+
+
+" handlers for notifications
+
+let s:handlers = {
+ \ 'fsharp/notifyWorkspace': 'fsharp#handle_notifyWorkspace',
+ \ }
+
+function! s:registerAutocmds()
+ if g:fsharp#backend == 'nvim' && g:fsharp#lsp_codelens
+ augroup FSharp_AutoRefreshCodeLens
+ autocmd!
+ autocmd CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()
+ augroup END
+ endif
+ if g:fsharp#backend != 'disable'
+ augroup FSharp_OnCursorMove
+ autocmd!
+ autocmd CursorMoved *.fs,*.fsi,*.fsx call fsharp#OnCursorMove()
+ augroup END
+ endif
+endfunction
+
+function! fsharp#initialize()
+ echom '[FSAC] Initialized'
+ if g:fsharp#backend == 'languageclient-neovim'
+ call LanguageClient_registerHandlers(s:handlers)
+ endif
+ call fsharp#updateServerConfig()
+ call s:registerAutocmds()
+endfunction
+
+
+" nvim-lsp specific functions
+
+" handlers are picked up by ionide.setup()
+function! fsharp#get_handlers()
+ return s:handlers
endfunction
+let s:callbacks = {}
+
+function! fsharp#register_callback(fn)
+ if g:fsharp#backend != 'nvim'
+ return -1
+ endif
+ let rnd = reltimestr(reltime())
+ let s:callbacks[rnd] = a:fn
+ return rnd
+endfunction
+
+function! fsharp#resolve_callback(key, arg)
+ if g:fsharp#backend != 'nvim'
+ return
+ endif
+ if has_key(s:callbacks, a:key)
+ let Callback = s:callbacks[a:key]
+ call Callback(a:arg)
+ call remove(s:callbacks, a:key)
+ endif
+endfunction
+
+
+" .NET/F# specific operations
+
function! s:findWorkspace(dir, cont)
let s:cont_findWorkspace = a:cont
function! s:callback_findWorkspace(result)
@@ -237,13 +332,20 @@ endfunction
let s:workspace = []
+function! fsharp#handle_notifyWorkspace(payload) abort
+ let content = json_decode(a:payload.content)
+ if content.Kind == 'projectLoading'
+ echom "[FSAC] Loading" content.Data.Project
+ let s:workspace = uniq(sort(add(s:workspace, content.Data.Project)))
+ elseif content.Kind == 'workspaceLoad' && content.Data.Status == 'finished'
+ echom printf("[FSAC] Workspace loaded (%d project(s))", len(s:workspace))
+ call fsharp#updateServerConfig()
+ endif
+endfunction
+
+
function! s:load(arg)
- let s:loading_workspace = a:arg
- function! s:callback_load(_)
- echo "[FSAC] Workspace loaded: " . join(s:loading_workspace, ', ')
- let s:workspace = s:workspace + s:loading_workspace
- endfunction
- call s:workspaceLoad(a:arg, function("s:callback_load"))
+ call s:workspaceLoad(a:arg, v:null)
endfunction
function! fsharp#loadProject(...)
@@ -254,23 +356,15 @@ function! fsharp#loadProject(...)
call s:load(prjs)
endfunction
-function! fsharp#loadWorkspaceAuto()
- if &ft == 'fsharp'
- call fsharp#updateServerConfig()
- if g:fsharp#automatic_workspace_init
- echom "[FSAC] Loading workspace..."
- let bufferDirectory = fnamemodify(resolve(expand('%:p')), ':h')
- call s:findWorkspace(bufferDirectory, function("s:load"))
- endif
- endif
+function! fsharp#showLoadedProjects()
+ for proj in s:workspace
+ echo "-" proj
+ endfor
endfunction
function! fsharp#reloadProjects()
if len(s:workspace) > 0
- function! s:callback_reloadProjects(_)
- call s:prompt("[FSAC] Workspace reloaded.")
- endfunction
- call s:workspaceLoad(s:workspace, function("s:callback_reloadProjects"))
+ call s:workspaceLoad(s:workspace, v:null)
else
echom "[FSAC] Workspace is empty"
endif
@@ -288,7 +382,7 @@ function! fsharp#showSignature()
if exists('result.result.content')
let content = json_decode(result.result.content)
if exists('content.Data')
- echom substitute(content.Data, '\n\+$', ' ', 'g')
+ echo substitute(content.Data, '\n\+$', ' ', 'g')
endif
endif
endfunction
@@ -306,13 +400,21 @@ function! fsharp#showF1Help()
echo result
endfunction
+function! s:hover()
+ if g:fsharp#backend == 'languageclient-neovim'
+ call LanguageClient#textDocument_hover()
+ elseif g:fsharp#backend == 'nvim'
+ lua vim.lsp.buf.hover()
+ endif
+endfunction
+
function! fsharp#showTooltip()
function! s:callback_showTooltip(result)
let result = a:result
if exists('result.result.content')
let content = json_decode(result.result.content)
if exists('content.Data')
- call LanguageClient#textDocument_hover()
+ call s:hover()
endif
endif
endfunction
@@ -320,12 +422,8 @@ function! fsharp#showTooltip()
call s:signature(expand('%:p'), line('.') - 1, col('.') - 1, function("s:callback_showTooltip"))
endfunction
-let s:script_root_dir = expand('<sfile>:p:h') . "/../"
-let s:fsac = fnamemodify(s:script_root_dir . "fsac/fsautocomplete.dll", ":p")
-let g:fsharp#languageserver_command =
- \ ['dotnet', s:fsac,
- \ '--background-service-enabled'
- \ ]
+
+" FSAC update utils
function! s:update_win()
echom "[FSAC] Downloading FSAC. This may take a while..."
@@ -357,6 +455,9 @@ function! fsharp#updateFSAC(...)
endif
endfunction
+
+" FSI integration
+
let s:fsi_buffer = -1
let s:fsi_job = -1
let s:fsi_width = 0
@@ -385,7 +486,6 @@ endfunction
function! fsharp#openFsi(returnFocus)
if bufwinid(s:fsi_buffer) <= 0
let fsi_command = s:get_fsi_command()
- " Neovim
if exists('*termopen') || exists('*term_start')
let current_win = win_getid()
execute g:fsharp#fsi_window_command
@@ -429,7 +529,7 @@ function! fsharp#openFsi(returnFocus)
if a:returnFocus | call s:win_gotoid_safe(current_win) | endif
return s:fsi_buffer
else
- echom "[FSAC] Your Vim does not support terminal".
+ echom "[FSAC] Your (neo)vim does not support terminal".
return 0
endif
endif
@@ -517,6 +617,7 @@ function! fsharp#sendAllToFsi()
return fsharp#sendFsi(text)
endfunction
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/autoload/puppet/align.vim b/autoload/puppet/align.vim
index 56270f09..811dee3d 100644
--- a/autoload/puppet/align.vim
+++ b/autoload/puppet/align.vim
@@ -2,11 +2,11 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'puppet', 'autoload/puppet/ali
finish
endif
-function! puppet#align#IndentLevel(lnum)
+function! puppet#align#IndentLevel(lnum) abort
return indent(a:lnum) / &shiftwidth
endfunction
-function! puppet#align#LinesInBlock(lnum)
+function! puppet#align#LinesInBlock(lnum) abort
let lines = []
let indent_level = puppet#align#IndentLevel(a:lnum)
diff --git a/autoload/puppet/ctags.vim b/autoload/puppet/ctags.vim
index e5c7321e..1a12890a 100644
--- a/autoload/puppet/ctags.vim
+++ b/autoload/puppet/ctags.vim
@@ -10,9 +10,9 @@ endif
let s:ctags_options_dir = expand('<sfile>:p:h:h:h') . '/ctags/'
" Return full path to option file for ctags application
-function! puppet#ctags#OptionFile()
+function! puppet#ctags#OptionFile() abort
- if puppet#ctags#Type() == 'universal'
+ if puppet#ctags#Type() ==? 'universal'
let l:ctags_options = 'puppet_u.ctags'
else
let l:ctags_options = 'puppet.ctags'
@@ -22,13 +22,13 @@ endfunction
" Return type of installed ctags application,
" can be 'universal' or 'exuberant'
-function! puppet#ctags#Type()
+function! puppet#ctags#Type() abort
if !s:ctags_type
let l:version = system('ctags --version')
- if l:version =~ 'Universal Ctags'
+ if l:version =~? 'Universal Ctags'
let s:ctags_type = 'universal'
- elseif l:version =~ 'Exuberant Ctags'
+ elseif l:version =~? 'Exuberant Ctags'
let s:ctags_type = 'exuberant'
else
echoerr 'Unknown version of Ctags'
diff --git a/compiler/puppet-lint.vim b/compiler/puppet-lint.vim
index c65eeb19..584d0e19 100644
--- a/compiler/puppet-lint.vim
+++ b/compiler/puppet-lint.vim
@@ -6,12 +6,12 @@ endif
" Compiler: puppet-lint
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-if exists("current_compiler")
+if exists('current_compiler')
finish
endif
-let current_compiler = "puppet-lint"
+let current_compiler = 'puppet-lint'
-if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+if exists(':CompilerSet') != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
diff --git a/ftplugin/epuppet.vim b/ftplugin/epuppet.vim
index 482d2af1..9c2156d5 100644
--- a/ftplugin/epuppet.vim
+++ b/ftplugin/epuppet.vim
@@ -9,7 +9,7 @@ endif
" Last Change: 2019-09-01
" Only do this when not done yet for this buffer
-if exists("b:did_ftplugin")
+if exists('b:did_ftplugin')
finish
endif
@@ -17,23 +17,23 @@ let s:save_cpo = &cpo
set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
-let s:undo_ftplugin = ""
+let s:undo_ftplugin = ''
let s:browsefilter = "All Files (*.*)\t*.*\n"
-let s:match_words = ""
+let s:match_words = ''
runtime! ftplugin/sh.vim
unlet! b:did_ftplugin
" Override our defaults if these were set by an included ftplugin.
-if exists("b:undo_ftplugin")
+if exists('b:undo_ftplugin')
let s:undo_ftplugin = b:undo_ftplugin
unlet b:undo_ftplugin
endif
-if exists("b:browsefilter")
+if exists('b:browsefilter')
let s:browsefilter = b:browsefilter
unlet b:browsefilter
endif
-if exists("b:match_words")
+if exists('b:match_words')
let s:match_words = b:match_words
unlet b:match_words
endif
@@ -46,13 +46,13 @@ runtime! ftplugin/puppet.vim
let b:did_ftplugin = 1
" Combine the new set of values with those previously included.
-if exists("b:undo_ftplugin")
- let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
+if exists('b:undo_ftplugin')
+ let s:undo_ftplugin = b:undo_ftplugin . ' | ' . s:undo_ftplugin
endif
-if exists ("b:browsefilter")
+if exists ('b:browsefilter')
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
endif
-if exists("b:match_words")
+if exists('b:match_words')
let s:match_words = b:match_words . ',' . s:match_words
endif
@@ -64,14 +64,14 @@ let &l:suffixesadd = s:suffixesadd . (s:suffixesadd =~# ',$\|^$' ? '' : ',') . &
unlet s:include s:path s:suffixesadd
" Load the combined list of match_words for matchit.vim
-if exists("loaded_matchit")
+if exists('loaded_matchit')
let b:match_words = s:match_words
endif
" TODO: comments=
setlocal commentstring=<%#%s%>
-let b:undo_ftplugin = "setl cms< "
+let b:undo_ftplugin = 'setl cms< '
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
let &cpo = s:save_cpo
diff --git a/ftplugin/puppet.vim b/ftplugin/puppet.vim
index 0d461238..5316cf5e 100644
--- a/ftplugin/puppet.vim
+++ b/ftplugin/puppet.vim
@@ -8,7 +8,7 @@ endif
" URL: https://github.com/rodjek/vim-puppet
" Last Change: 2019-08-31
-if (exists("b:did_ftplugin"))
+if (exists('b:did_ftplugin'))
finish
endif
let b:did_ftplugin = 1
@@ -25,8 +25,8 @@ setlocal commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
setlocal formatexpr=puppet#format#Format()
-let b:undo_ftplugin = "
+let b:undo_ftplugin = '
\ setlocal tabstop< tabstop< softtabstop< shiftwidth< expandtab<
\| setlocal keywordprg< iskeyword< comments< commentstring<
\| setlocal formatoptions< formatexpr<
- \"
+ \'
diff --git a/ftplugin/puppet_tagbar.vim b/ftplugin/puppet_tagbar.vim
index 4e87669e..dc2c73e6 100644
--- a/ftplugin/puppet_tagbar.vim
+++ b/ftplugin/puppet_tagbar.vim
@@ -25,7 +25,7 @@ let g:tagbar_type_puppet = {
\],
\}
-if puppet#ctags#Type() == 'universal'
+if puppet#ctags#Type() ==? 'universal'
" There no sense to split objects by colon
let g:tagbar_type_puppet.sro = '__'
let g:tagbar_type_puppet.kind2scope = {
diff --git a/ftplugin/terraform.vim b/ftplugin/terraform.vim
index 1f4ef2cc..7e56d9ed 100644
--- a/ftplugin/terraform.vim
+++ b/ftplugin/terraform.vim
@@ -30,9 +30,6 @@ if exists('s:hcl_fold_sections_save')
let g:hcl_fold_sections = s:hcl_fold_sections_save
end
-let s:cpo_save = &cpoptions
-set cpoptions&vim
-
if !exists('g:terraform_binary_path')
let g:terraform_binary_path='terraform'
endif
diff --git a/indent/puppet.vim b/indent/puppet.vim
index 1067e9e0..ec714265 100644
--- a/indent/puppet.vim
+++ b/indent/puppet.vim
@@ -8,7 +8,7 @@ endif
" Last Change: 2009 Aug 19
" vim: set sw=4 sts=4:
-if exists("b:did_indent")
+if exists('b:did_indent')
finish
endif
let b:did_indent = 1
@@ -17,11 +17,11 @@ setlocal autoindent smartindent
setlocal indentexpr=GetPuppetIndent()
setlocal indentkeys+=0],0)
-let b:undo_indent = "
+let b:undo_indent = '
\ setlocal autoindent< smartindent< indentexpr< indentkeys<
- \"
+ \'
-if exists("*GetPuppetIndent")
+if exists('*GetPuppetIndent')
finish
endif
@@ -37,7 +37,7 @@ function! s:PartOfInclude(lnum)
if line !~ ',$'
break
endif
- if line =~ '^\s*include\s\+[^,]\+,$' && line !~ '[=>]>'
+ if line =~# '^\s*include\s\+[^,]\+,$' && line !~ '[=>]>'
return 1
endif
endwhile
@@ -84,7 +84,7 @@ function! GetPuppetIndent(...)
" the same indent here would be premature since for that particular case
" we want to instead get the indent level of the matching opening brace or
" parenthenses.
- if pline =~ '^\s*#' && line !~ '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)'
+ if pline =~# '^\s*#' && line !~# '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)'
return ind
endif
@@ -123,12 +123,12 @@ function! GetPuppetIndent(...)
endif
" Match } }, }; ] ]: ], ]; )
- if line =~ '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)'
+ if line =~# '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)'
let ind = indent(s:OpenBrace(v:lnum))
endif
" Don't actually shift over for } else {
- if line =~ '^\s*}\s*els\(e\|if\).*{\s*$'
+ if line =~# '^\s*}\s*els\(e\|if\).*{\s*$'
let ind -= &sw
endif
" Don't indent resources that are one after another with a ->(ordering arrow)
diff --git a/indent/ruby.vim b/indent/ruby.vim
index afa72995..e4a295fd 100644
--- a/indent/ruby.vim
+++ b/indent/ruby.vim
@@ -93,6 +93,9 @@ let s:ruby_indent_keywords =
\ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
+" Def without an end clause: def method_call(...) = <expression>
+let s:ruby_endless_def = '\<def\s\+\k\+[!?]\=\%((.*)\|\s\)\s*='
+
" Regex used for words that, at the start of a line, remove a level of indent.
let s:ruby_deindent_keywords =
\ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\):\@!\>'
@@ -112,10 +115,26 @@ let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>
" Regex that defines the end-match for the 'end' keyword.
let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
-" Expression used for searchpair() call for finding match for 'end' keyword.
-let s:end_skip_expr = s:skip_expr .
- \ ' || (expand("<cword>") == "do"' .
- \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
+" Expression used for searchpair() call for finding a match for an 'end' keyword.
+function! s:EndSkipExpr()
+ if eval(s:skip_expr)
+ return 1
+ elseif expand('<cword>') == 'do'
+ \ && getline(".") =~ '^\s*\<\(while\|until\|for\):\@!\>'
+ return 1
+ elseif getline('.') =~ s:ruby_endless_def
+ return 1
+ elseif getline('.') =~ '\<def\s\+\k\+[!?]\=([^)]*$'
+ " Then it's a `def method(` with a possible `) =` later
+ call search('\<def\s\+\k\+\zs(', 'W', line('.'))
+ normal! %
+ return getline('.') =~ ')\s*='
+ else
+ return 0
+ endif
+endfunction
+
+let s:end_skip_expr = function('s:EndSkipExpr')
" Regex that defines continuation lines, not including (, {, or [.
let s:non_bracket_continuation_regex =
@@ -575,6 +594,11 @@ function! s:AfterUnbalancedBracket(pline_info) abort
call cursor(info.plnum, closing.pos + 1)
normal! %
+ if strpart(info.pline, closing.pos) =~ '^)\s*='
+ " special case: the closing `) =` of an endless def
+ return indent(s:GetMSL(line('.')))
+ endif
+
if s:Match(line('.'), s:ruby_indent_keywords)
return indent('.') + info.sw
else
@@ -613,7 +637,7 @@ function! s:AfterIndentKeyword(pline_info) abort
let info = a:pline_info
let col = s:Match(info.plnum, s:ruby_indent_keywords)
- if col > 0
+ if col > 0 && s:Match(info.plnum, s:ruby_endless_def) <= 0
call cursor(info.plnum, col)
let ind = virtcol('.') - 1 + info.sw
" TODO: make this better (we need to count them) (or, if a searchpair
@@ -660,7 +684,7 @@ function! s:IndentingKeywordInMSL(msl_info) abort
" TODO: this does not take into account contrived things such as
" module Foo; class Bar; end
let col = s:Match(info.plnum_msl, s:ruby_indent_keywords)
- if col > 0
+ if col > 0 && s:Match(info.plnum_msl, s:ruby_endless_def) <= 0
let ind = indent(info.plnum_msl) + info.sw
if s:Match(info.plnum_msl, s:end_end_regex)
let ind = ind - info.sw
diff --git a/syntax/ansible.vim b/syntax/ansible.vim
index 8a10ec59..1398a8c7 100644
--- a/syntax/ansible.vim
+++ b/syntax/ansible.vim
@@ -92,7 +92,7 @@ if exists("g:ansible_extra_keywords_highlight")
\ debugger always_run check_mode diff no_log args tags force_handlers
\ vars vars_files vars_prompt delegate_facts delegate_to
\ any_errors_fatal ignore_errors ignore_unreachable max_fail_percentage
- \ connection hosts port remote_user module_defaults
+ \ connection children hosts port remote_user module_defaults
\ environment fact_path gather_facts gather_subset gather_timeout
\ async poll throttle timeout order run_once serial strategy
\ containedin='.s:yamlKey.' contained'
diff --git a/syntax/basic/members.vim b/syntax/basic/members.vim
index 46b8350b..b3705e30 100644
--- a/syntax/basic/members.vim
+++ b/syntax/basic/members.vim
@@ -36,7 +36,7 @@ syntax keyword typescriptClassStatic static
syntax keyword typescriptAccessibilityModifier public private protected contained
-syntax keyword typescriptReadonlyModifier readonly contained
+syntax keyword typescriptReadonlyModifier readonly override contained
syntax region typescriptStringMember contained
\ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1/
diff --git a/syntax/epuppet.vim b/syntax/epuppet.vim
index 61c70d21..d0c5f965 100644
--- a/syntax/epuppet.vim
+++ b/syntax/epuppet.vim
@@ -9,7 +9,7 @@ endif
" Last Change: 2019-09-01
" quit when a syntax file was already loaded {{{1
-if exists("b:current_syntax")
+if exists('b:current_syntax')
finish
endif
@@ -29,5 +29,5 @@ syn region ePuppetComment matchgroup=ePuppetDelimiter start="<%-\=#" end=
hi def link ePuppetDelimiter PreProc
hi def link ePuppetComment Comment
-let b:current_syntax = "epuppet"
+let b:current_syntax = 'epuppet'
diff --git a/syntax/git.vim b/syntax/git.vim
index 558d39b5..9d8efc69 100644
--- a/syntax/git.vim
+++ b/syntax/git.vim
@@ -33,7 +33,7 @@ syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
syn match gitDiffRemoved "\[-[^]]*-\]" contained containedin=gitDiff
-syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\|gpgsig\|summary\|boundary\|filename\|previous\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite contains=@NoSpell
+syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\|gpgsig\%(-\w\+\)\=\|summary\|boundary\|filename\|previous\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite contains=@NoSpell
syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite contains=@NoSpell
syn match gitKeyword /^Merge:/ contained containedin=gitHead nextgroup=gitHashAbbrev skipwhite contains=@NoSpell
syn match gitMode /^\d\{6\}\>/ contained containedin=gitHead nextgroup=gitType,gitHash skipwhite
diff --git a/syntax/puppet.vim b/syntax/puppet.vim
index b246f753..470404e4 100644
--- a/syntax/puppet.vim
+++ b/syntax/puppet.vim
@@ -10,7 +10,7 @@ endif
" and heredoc was copied from ruby and then modified to comply with Puppet syntax.
" Prelude {{{1
-if exists("b:current_syntax")
+if exists('b:current_syntax')
finish
endif
@@ -437,4 +437,4 @@ HiLink puppetComment Comment
delcommand HiLink
-let b:current_syntax = "puppet"
+let b:current_syntax = 'puppet'