Skip to content

Commit

Permalink
vim: conjure-highlight: falling back to empty b:clojure_syntax_keywor…
Browse files Browse the repository at this point in the history
…ds if it fails to execute
  • Loading branch information
Pancia committed Aug 24, 2020
1 parent 739abd1 commit 347e602
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions lib/vim/conjure-highlight/autoload/conjure_highlight.vim
Expand Up @@ -6,3 +6,19 @@ endfunction
function! conjure_highlight#clojure_highlight_filepath()
return globpath(&runtimepath, 'autoload/conjure_highlight.clj')
endfunction

function! conjure_highlight#execute_syntax_command(cmd)
try
"echomsg a:cmd
execute a:cmd
let &syntax = &syntax
"echomsg 'ch.vim/done'
catch /.*/
"echomsg 'ch.vim/catch'
let b:clojure_syntax_keywords = {}
let &syntax = &syntax
endtry
endfunction

" Used by main.lua, using function directly had no effect
command! -nargs=1 ExecuteSyntaxCommand :call conjure_highlight#execute_syntax_command(<args>)
3 changes: 1 addition & 2 deletions lib/vim/conjure-highlight/lua/conjure-highlight/main.lua
Expand Up @@ -40,8 +40,7 @@ end
local function execute_syntax_command()
eval_str("(ns-name *ns*)", function(ns)
eval_str("(conjure-highlight/syntax-command (quote "..ns.."))", function(r)
vim.api.nvim_command("execute "..r)
vim.api.nvim_command("let &syntax = &syntax")
vim.api.nvim_command("ExecuteSyntaxCommand "..r)
end)
end)
end
Expand Down

0 comments on commit 347e602

Please sign in to comment.