Fix a few errors

This commit is contained in:
baabelfish 2016-02-13 14:11:40 +02:00
commit 26aa6a5cbb
6 changed files with 37 additions and 20 deletions

View file

@ -180,7 +180,7 @@ function! s:RenderOutline()
exec ":" . len(rlines) exec ":" . len(rlines)
normal! dG normal! dG
if !wasFocused && g:nvim_nim_outline_track_symbol && closest != 0 if !wasFocused && g:nvim_nim_outline_track_symbol && closest != 0 && has_key(s:buffermap, closest)
call cursor(s:buffermap[closest], 2) call cursor(s:buffermap[closest], 2)
normal zz normal zz
normal ^ normal ^

View file

@ -1,10 +1,9 @@
scriptencoding utf-8 scriptencoding utf-8
if exists("s:loaded") let s:save_cpo = &cpo
finish set cpo&vim
endif
let s:loaded = 1
let s:all_highlights = { let s:all_highlights = {
\ 'skProc': "Function", \ 'skProc': "Function",
@ -51,13 +50,20 @@ endfunction
function! s:NimHighlighter.on_stderr(job, chunk) function! s:NimHighlighter.on_stderr(job, chunk)
endfunction endfunction
function! Remove(id)
try
call matchdelete(a:id)
catch /E803:/
endtry
endfunction
function! s:NimHighlighter.on_exit() function! s:NimHighlighter.on_exit()
if empty(self.lines) && self.file != expand("%:p") if empty(self.lines) && self.file != expand("%:p")
return return
endif endif
for m in b:highlights for m in b:highlights
call matchdelete(m) call Remove(m)
endfor endfor
let b:highlights = [] let b:highlights = []
@ -130,3 +136,7 @@ function! highlighter#guard()
endif endif
endif endif
endfunction endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -1,10 +1,8 @@
scriptencoding utf-8 scriptencoding utf-8
if exists("s:loaded") let s:save_cpo = &cpo
finish set cpo&vim
endif
let s:loaded = 1
function! modules#FindImportLocation() function! modules#FindImportLocation()
@ -83,3 +81,7 @@ endfunction
function! modules#FindGlobalImports() function! modules#FindGlobalImports()
return modules#ImportMap(globpath(g:nvim_nim_deps_nim, "**/*.nim", 0, 1)) return modules#ImportMap(globpath(g:nvim_nim_deps_nim, "**/*.nim", 0, 1))
endfunction endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -1,10 +1,9 @@
scriptencoding utf-8 scriptencoding utf-8
if exists("s:loaded") let s:save_cpo = &cpo
finish set cpo&vim
endif
let s:loaded = 1
function! omni#item(parsed) function! omni#item(parsed)
return { return {
@ -70,3 +69,7 @@ function! omni#nim(findstart, base)
\ 'words': completions, \ 'words': completions,
\ 'refresh': 'always' } \ 'refresh': 'always' }
endfunction endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -1,10 +1,7 @@
scriptencoding utf-8 scriptencoding utf-8
let s:save_cpo = &cpo
if exists("s:loaded") set cpo&vim
finish
endif
let s:loaded = 1
let s:idtypes = { let s:idtypes = {
@ -298,3 +295,7 @@ function! NimReplSend(motion_wiseness)
echom str echom str
call features#repl#send(str) call features#repl#send(str)
endfunction endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -59,7 +59,8 @@ let g:nvim_nim_enable_custom_textobjects = 1
let g:nvim_nim_highlighter_enable = 1 let g:nvim_nim_highlighter_enable = 1
let g:nvim_nim_highlight_builtin = 1 let g:nvim_nim_highlight_builtin = 1
let g:nvim_nim_highlighter_semantics = ["skConst", "skForVar", "skGlobalVar", "skGlobalLet", "skLet", "skModule", "skParam", "skTemp", "skVar"] " let g:nvim_nim_highlighter_semantics = ["skConst", "skForVar", "skGlobalVar", "skGlobalLet", "skLet", "skModule", "skParam", "skTemp", "skVar"]
let g:nvim_nim_highlighter_semantics = []
call highlighter#select_highlights(["skProc", "skTemplate", "skType", "skMacro", "skMethod", "skField", "skForVar", "skIterator"]) call highlighter#select_highlights(["skProc", "skTemplate", "skType", "skMacro", "skMethod", "skField", "skForVar", "skIterator"])