diff options
Diffstat (limited to 'after')
-rw-r--r-- | after/ftplugin/llvm.vim | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/after/ftplugin/llvm.vim b/after/ftplugin/llvm.vim index bb1ee63e..79fbac35 100644 --- a/after/ftplugin/llvm.vim +++ b/after/ftplugin/llvm.vim @@ -329,7 +329,7 @@ function! s:extract_identifier(word) abort return '' endif - if a:word[1] == '"' + if a:word[1] ==# '"' let idx = stridx(a:word, '"', 2) if idx == -1 return '' @@ -343,7 +343,7 @@ function! s:extract_identifier(word) abort endif if prefix ==# '#' - return matchstr(a:word, '^#\d\+') + return matchstr(a:word, '^#\d\+\>') endif return '' @@ -478,8 +478,14 @@ function! s:run_lli(...) abort let tmpfile = tempname() call writefile(getline(1, '$'), tmpfile) let Cleanup = {ch -> filereadable(tmpfile) ? delete(tmpfile) : 0} - let bufnr = term_start([g:llvm_ext_lli_executable, tmpfile], {'close_cb': Cleanup, 'exit_cb': Cleanup}) - echo 'Run lli in termnal buffer(' . bufnr . ')' + try + let bufnr = term_start([g:llvm_ext_lli_executable, tmpfile], {'close_cb': Cleanup, 'exit_cb': Cleanup}) + echo 'Run lli in termnal buffer(' . bufnr . ')' + catch + if filereadable(tmpfile) + delete(tmpfile) + endif + endtry endfunction if !exists(':LLI') |