nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

[BUG] nixvimInjections don't seem to work on nightly

Open jonboh opened this issue 1 year ago • 1 comments

Field Description
Plugin treesitter
Nixpkgs unstable

  • [x] I have read the FAQ and my bug is not listed there.

Description

The nixvimInjections option does not work on nighlty builds of neovim. The extraConfigLua regions do not get properly highlighted as lua code. A minor thing, but I thought it worth to report :)

Minimal, Reproducible Example (MRE)

I'm able to reproduce the behavior with this minimal flake:

{
  description = "A nixvim configuration";

  inputs = {
    nixvim.url = "github:nix-community/nixvim";
    flake-utils.url = "github:numtide/flake-utils";
    nixneovimplugins.url = "github:NixNeovim/NixNeovimPlugins";
    neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
  };

  outputs = {
    nixpkgs,
    nixvim,
    flake-utils,
    nixneovimplugins,
    ...
  } @ inputs:
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs-nightly = import nixpkgs {
        inherit system;
        overlays = [
          nixneovimplugins.overlays.default
          inputs.neovim-nightly-overlay.overlay
        ];
      };
      pkgs = import nixpkgs {
        inherit system;
        overlays = [
          nixneovimplugins.overlays.default
        ];
      };
      nixvim' = nixvim.legacyPackages.${system};
      inject = nixvim'.makeNixvimWithModule {
        inherit pkgs;
        module = {
          plugins.treesitter = {
            enable = true;
            nixvimInjections = true;
          };
        };
      };
      inject-nightly = nixvim'.makeNixvimWithModule {
        pkgs = pkgs-nightly;
        module = {
          plugins.treesitter = {
            enable = true;
            nixvimInjections = true;
          };
        };
      };
    in {
      packages = {
        inherit inject;
        inherit inject-nightly;
      };
    });
}

nix run ".#inject" and nix run ".#inject-nightly" for the different versions. Opening any file with extraConfigLua should show that the nighly version does not properly highlight those regions.

jonboh avatar Mar 31 '24 09:03 jonboh