vint: Use abort attributes
This commit is contained in:
parent
7cead42bb1
commit
cdccc96c56
1 changed files with 12 additions and 12 deletions
|
|
@ -13,7 +13,7 @@ if has('pythonx')
|
||||||
exe 'pyxfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
|
exe 'pyxfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
fun! nim#init()
|
fun! nim#init() abort
|
||||||
let cmd = printf('nim --dump.format:json --verbosity:0 dump %s', s:CurrentNimFile())
|
let cmd = printf('nim --dump.format:json --verbosity:0 dump %s', s:CurrentNimFile())
|
||||||
let raw_dumpdata = system(cmd)
|
let raw_dumpdata = system(cmd)
|
||||||
if !v:shell_error && expand('%:e') == 'nim'
|
if !v:shell_error && expand('%:e') == 'nim'
|
||||||
|
|
@ -35,7 +35,7 @@ fun! nim#init()
|
||||||
endif
|
endif
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! s:UpdateNimLog()
|
fun! s:UpdateNimLog() abort
|
||||||
setlocal buftype=nofile
|
setlocal buftype=nofile
|
||||||
setlocal bufhidden=hide
|
setlocal bufhidden=hide
|
||||||
setlocal noswapfile
|
setlocal noswapfile
|
||||||
|
|
@ -66,7 +66,7 @@ command! NimTerminateService
|
||||||
command! NimRestartService
|
command! NimRestartService
|
||||||
\ :exe printf("pyx nimRestartService('%s')", b:nim_project_root)
|
\ :exe printf("pyx nimRestartService('%s')", b:nim_project_root)
|
||||||
|
|
||||||
fun! s:CurrentNimFile()
|
fun! s:CurrentNimFile() abort
|
||||||
let save_cur = getpos('.')
|
let save_cur = getpos('.')
|
||||||
call cursor(0, 0, 0)
|
call cursor(0, 0, 0)
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ let g:nim_symbol_types = {
|
||||||
\ 'skEnumField': 'v',
|
\ 'skEnumField': 'v',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
fun! NimExec(op)
|
fun! NimExec(op) abort
|
||||||
let isDirty = getbufvar(bufnr('%'), '&modified')
|
let isDirty = getbufvar(bufnr('%'), '&modified')
|
||||||
if isDirty
|
if isDirty
|
||||||
let tmp = tempname() . bufname('%') . '_dirty.nim'
|
let tmp = tempname() . bufname('%') . '_dirty.nim'
|
||||||
|
|
@ -128,12 +128,12 @@ fun! NimExec(op)
|
||||||
return output
|
return output
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! NimExecAsync(op, Handler)
|
fun! NimExecAsync(op, Handler) abort
|
||||||
let result = NimExec(a:op)
|
let result = NimExec(a:op)
|
||||||
call a:Handler(result)
|
call a:Handler(result)
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! NimComplete(findstart, base)
|
fun! NimComplete(findstart, base) abort
|
||||||
if b:nim_caas_enabled == 0
|
if b:nim_caas_enabled == 0
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|
@ -178,7 +178,7 @@ let g:neocomplete#sources#omni#input_patterns['nim'] = '[^. *\t]\.\w*'
|
||||||
|
|
||||||
let g:nim_completion_callbacks = {}
|
let g:nim_completion_callbacks = {}
|
||||||
|
|
||||||
fun! NimAsyncCmdComplete(cmd, output)
|
fun! NimAsyncCmdComplete(cmd, output) abort
|
||||||
call add(g:nim_log, a:output)
|
call add(g:nim_log, a:output)
|
||||||
echom g:nim_completion_callbacks
|
echom g:nim_completion_callbacks
|
||||||
if has_key(g:nim_completion_callbacks, a:cmd)
|
if has_key(g:nim_completion_callbacks, a:cmd)
|
||||||
|
|
@ -191,7 +191,7 @@ fun! NimAsyncCmdComplete(cmd, output)
|
||||||
return 1
|
return 1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! GotoDefinition_nim_ready(def_output)
|
fun! GotoDefinition_nim_ready(def_output) abort
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
echo 'nim was unable to locate the definition. exit code: ' . v:shell_error
|
echo 'nim was unable to locate the definition. exit code: ' . v:shell_error
|
||||||
" echoerr a:def_output
|
" echoerr a:def_output
|
||||||
|
|
@ -211,23 +211,23 @@ fun! GotoDefinition_nim_ready(def_output)
|
||||||
return 1
|
return 1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! GotoDefinition_nim()
|
fun! GotoDefinition_nim() abort
|
||||||
call NimExecAsync('--def', function('GotoDefinition_nim_ready'))
|
call NimExecAsync('--def', function('GotoDefinition_nim_ready'))
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fun! FindReferences_nim()
|
fun! FindReferences_nim() abort
|
||||||
setloclist()
|
setloclist()
|
||||||
endf
|
endf
|
||||||
|
|
||||||
" Syntastic syntax checking
|
" Syntastic syntax checking
|
||||||
fun! SyntaxCheckers_nim_nim_GetLocList()
|
fun! SyntaxCheckers_nim_nim_GetLocList() abort
|
||||||
let makeprg = 'nim check --hints:off --listfullpaths ' . s:CurrentNimFile()
|
let makeprg = 'nim check --hints:off --listfullpaths ' . s:CurrentNimFile()
|
||||||
let errorformat = &errorformat
|
let errorformat = &errorformat
|
||||||
|
|
||||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
endf
|
endf
|
||||||
|
|
||||||
function! SyntaxCheckers_nim_nim_IsAvailable()
|
function! SyntaxCheckers_nim_nim_IsAvailable() abort
|
||||||
return executable('nim')
|
return executable('nim')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue