Skip to content

Commit

Permalink
Add a flag to disable treesitter and hopefully rely on the old syntax…
Browse files Browse the repository at this point in the history
… system #571

I'm unsure if setting syntax=on enables the old syntax highlighting in
this one buffer or not. Maybe it re-activates TS?
  • Loading branch information
Olical committed May 19, 2024
1 parent 16594bb commit f6e4eec
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 76 deletions.
5 changes: 5 additions & 0 deletions doc/conjure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ configure the ones you care about one at a time you can set:
warnings you would normally see from your LSP setup if
switched off.
Default: `false`
*g:conjure#log#treesitter*
`g:conjure#log#treesitter`
Enables treesitter in the log buffer. You may want this off if you
notice large logs slowing down your editor.
Default: `true`

*g:conjure#log#break_length*
`g:conjure#log#break_length`
Expand Down
1 change: 1 addition & 0 deletions fnl/conjure/config.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
:log
{:wrap false
:diagnostics false
:treesitter true
:hud {:width 0.42
:height 0.3
:zindex 1
Expand Down
4 changes: 4 additions & 0 deletions fnl/conjure/log.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
(when (and vim.diagnostic (= false (config.get-in [:log :diagnostics])))
(vim.diagnostic.disable buf))

(when (and vim.treesitter (= false (config.get-in [:log :treesitter])))
(vim.treesitter.stop buf)
(nvim.buf_set_option buf :syntax "on"))

(nvim.buf_set_lines
buf 0 -1 false
[(str.join [(client.get :comment-prefix)
Expand Down
2 changes: 1 addition & 1 deletion lua/conjure/config.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f6e4eec

Please sign in to comment.