Skip to content

Commit

Permalink
fix syntax highlighting on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanisaacs committed Dec 11, 2022
1 parent 3e057e4 commit 818ea9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/treesitter/context.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ with builtins; let
in {
options.vim.treesitter.context.enable = mkOption {
type = types.bool;
default = false;
description = "enable function context [nvim-treesitter-context]";
};

Expand Down
7 changes: 4 additions & 3 deletions modules/treesitter/treesitter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ in {
};

fold = mkOption {
default = true;
default = false;
type = types.bool;
description = "enable fold with tree-sitter";
};
Expand Down Expand Up @@ -70,7 +70,8 @@ in {
)
];

vim.configRC.treesitter = writeIf cfg.fold (nvim.dag.entryAnywhere ''
# For some reason treesitter highlighting does not work on start if this is set before syntax on
vim.configRC.treesitter = writeIf cfg.fold (nvim.dag.entryBefore ["basic"] ''
" Tree-sitter based folding
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
Expand All @@ -86,7 +87,7 @@ in {
},
auto_install = false,
ensure_isntalled = {},
ensure_installed = {},
incremental_selection = {
enable = true,
Expand Down

0 comments on commit 818ea9d

Please sign in to comment.