Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colorizer not attaching to buffers #433

Open
1 task done
Jappie3 opened this issue Nov 2, 2024 · 4 comments
Open
1 task done

Colorizer not attaching to buffers #433

Jappie3 opened this issue Nov 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Jappie3
Copy link

Jappie3 commented Nov 2, 2024

⚠️ Please verify that this bug has NOT been reported before.

  • I checked all existing issues and didn't find a similar issue

Description

Colorizer does not attach when opening a buffer, when running :ColorizerAttachToBuffer it correctly highlights colors

👟 Reproduction steps

minimal reproducible example:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nvf.url = "github:notashelf/nvf";
  };

  outputs = {
    self,
    nixpkgs,
    ...
  } @ inputs: {
    packages."x86_64-linux" = {
      default =
        (inputs.nvf.lib.neovimConfiguration {
          modules = [
            {
              config.vim.theme.enable = true;
              config.vim.ui.colorizer.enable = true;
            }
          ];
          inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
        })
        .neovim;
    };
  };
}
nix run

type 'green' or 'red' -> no color highlighting
run :ColorizerAttachToBuffer -> color highlighting

👀 Expected behavior

Colorizer should work without explicitly attaching it to the buffer

😓 Actual Behavior

It did not attach to the buffer

💻 Metadata

  • system: "x86_64-linux" - host os: Linux 6.6.58, NixOS, 24.11 (Vicuna), 24.11.20241029.807e915 - multi-user?: yes - sandbox: yes - version: nix-env (Lix, like Nix) 2.91.0 System type: x86_64-linux Additional system types: aarch64-linux, i686-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/jasper/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/jasper/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/jasper/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/jasper/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/xjcvjdif1fv2zdsywa2g2r2rahymqbdm-lix-2.91.0/share - nixpkgs: /nix/store/m68ikm8045fj7ys7qvgr608z9l70hh1k-source

📝 Relevant log output

no clue how to get nvim logs tbh
@Jappie3 Jappie3 added the bug Something isn't working label Nov 2, 2024
@NotAShelf
Copy link
Owner

nvf does not enable the names feature for colorizer by default. You will need to enable it manually in colorizer.setupOpts. See: https://github.com/NotAShelf/nvf/blob/main/modules/plugins/ui/colorizer/colorizer.nix

@Jappie3
Copy link
Author

Jappie3 commented Nov 2, 2024

even adding colorizer.setupOpts.names = true;:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nvf.url = "github:notashelf/nvf";
  };

  outputs = {
    self,
    nixpkgs,
    ...
  } @ inputs: {
    packages."x86_64-linux" = {
      default =
        (inputs.nvf.lib.neovimConfiguration {
          modules = [
            {
              config.vim.theme.enable = true;
              config.vim.ui.colorizer = {
                enable = true;
                setupOpts.names = true;
              };
            }
          ];
          inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
        })
        .neovim;
    };
  };
}

it still does not attach to the buffer automatically, I manually have to run :ColorizerAttachToBuffer

@NotAShelf
Copy link
Owner

That is unusual, I'll take a look shortly.

@Jappie3
Copy link
Author

Jappie3 commented Nov 2, 2024

also color highlighting by name (e.g. 'blue', 'green') worked with the first flake example I posted... so either my system config (where it is enabled) is leaking (which could also mean that there's some incompatibility) or something weird is happening...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants