diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-07 20:41:49 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-07 20:41:49 +0200 |
| commit | 287fe4e29a5e67d02633fdc704d1197abd80eda8 (patch) | |
| tree | 5acbff01f4de348962f65df182d63a7aab743973 /ftplugin | |
| parent | add0ffbc6e2bdff0ca0321ddbec50aaf674e9521 (diff) | |
| download | vim-ai-287fe4e29a5e67d02633fdc704d1197abd80eda8.tar.gz | |
enabled code highlighting in scratch window
Diffstat (limited to '')
| -rw-r--r-- | ftplugin/aichat.vim | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ftplugin/aichat.vim b/ftplugin/aichat.vim index f49aad3..33b8141 100644 --- a/ftplugin/aichat.vim +++ b/ftplugin/aichat.vim @@ -99,7 +99,7 @@ function! s:IsHighlightSourcesEnabledForBuffer() endfunction function! s:MarkdownRefreshSyntax(force) - if g:vim_ai_chat_default['ui']['code_syntax_enabled'] + if g:vim_ai_chat_default['ui']['code_syntax_enabled'] && &filetype =~# 'aichat' call s:MarkdownHighlightSources(a:force) endif endfunction @@ -111,9 +111,10 @@ function! s:MarkdownClearSyntaxVariables() endfunction augroup Aichat - autocmd BufWinEnter *.aichat call s:MarkdownRefreshSyntax(1) - autocmd BufUnload *.aichat call s:MarkdownClearSyntaxVariables() - autocmd BufWritePost *.aichat call s:MarkdownRefreshSyntax(0) - autocmd InsertEnter,InsertLeave *.aichat call s:MarkdownRefreshSyntax(0) - autocmd CursorHold,CursorHoldI *.aichat call s:MarkdownRefreshSyntax(0) + autocmd! * <buffer> + autocmd BufWinEnter <buffer> call s:MarkdownRefreshSyntax(1) + autocmd BufUnload <buffer> call s:MarkdownClearSyntaxVariables() + autocmd BufWritePost <buffer> call s:MarkdownRefreshSyntax(0) + autocmd InsertEnter,InsertLeave <buffer> call s:MarkdownRefreshSyntax(0) + autocmd CursorHold,CursorHoldI <buffer> call s:MarkdownRefreshSyntax(0) augroup END |