nix-community / nixvim

Configure Neovim with Nix! [maintainers=@GaetanLepage, @traxys, @mattsturgeon, @khaneliman]
https://nix-community.github.io/nixvim
MIT License
1.81k stars 282 forks source link

[BUG] parinfer-rust throws E565: not allowed to change text or change window #1881

Open jakesarjeant opened 4 months ago

jakesarjeant commented 4 months ago
Field Description
Plugin parinfer-rust
Nixpkgs 24.05 and unstable
Home Manager N/A

Description

I would like to use parinfer-rust in my NixVim config. I enabled the plugin, but upon attempting to type a parenthesis or bracket, parinfer causes the error E565: Not allowed to change text or change window. Since I use stable nixpkgs, I tried setting plugins.parinfer-rust.package to the unstable version of the package in case this is a bug in parinfer-rust that has since been mitigated, to no avail. I used parinfer-rust in my previous (non-NixVim) config and never had such an issue.

Minimal, Reproducible Example (MRE)

programs.nixvim = {
  plugins.parinfer-rust.enable = true;
}
jakesarjeant commented 4 months ago

By the way: Although I'd rather use parinfer-rust, my current workaround is to just use nvim-parinfer:

{ pkgs, ... }:
{
  extraPlugins = [(pkgs.vimUtils.buildVimPlugin {
    name = "nvim-parinfer";
    src = pkgs.fetchFromGitHub {
      owner = "gpanders";
      repo = "nvim-parinfer";
      rev = "5ca0928";
      hash = "sha256-diwLtmch8LzaX7FIwBNy78n3iY7VnqMC1n0ep8k5kWE=";
    };
  })];
}
MattSturgeon commented 3 months ago

This sounds like an upstream bug. Unless you think something nixvim is doing is contributing to the issue?

Has the issue been reported upstream?

jakesarjeant commented 3 months ago

I'd be surprised if this is an upstream issue as I've been unable to reproduce it without installing through nixvim – then again, the issue happens even if I install the plugin as an extra, so it still might be. I'm not home right now, but I'll look into it when I get back

GaetanLepage commented 3 months ago

Are you sure this bug is not caused by the neovim version being too old (0.9.5 in nixos-24.05) ?

jakesarjeant commented 3 months ago

@GaetanLepage Oops, perhaps I misinterpreted the template. My system is on 24.05, but my NixVim flake uses nixpkgs/master. I'm also pretty sure it's not an issue with that version mismatch since I have the same issue on my mac where I have everything on unstable...

btw: my neovim :version reports 0.10.0

MattSturgeon commented 3 months ago

my NixVim flake uses nixpkgs/master

Unrelated to the main topic, but that sounds like a bad idea; you should probably use the nixos-unstable channel or at least something like nixos-unstable-small or nixpkgs-unstable.

plugins.parinfer-rust.enable = true;

If you can reproduce just with this, then our tests should catch this issue :confused:

jakesarjeant commented 3 months ago

my NixVim flake uses nixpkgs/master

Unrelated to the main topic, but that sounds like a bad idea; you should probably use the nixos-unstable channel or at least something like nixos-unstable-small or nixpkgs-unstable.

Fair enough, I wasn't really paying much attention to which channel I was using when I wrote the config. I'll make sure to fix that.

plugins.parinfer-rust.enable = true;

If you can reproduce just with this, then our tests should catch this issue :confused:

Okay, then it sounds like it's probably some kind of misconfiguration on my end. I don't really have time to mess with it at the moment but I'll take a look later this afternoon.

MattSturgeon commented 3 months ago

I don't really have time to mess with it at the moment but I'll take a look later this afternoon.

Please don't ever feel under pressure to respond quickly! Take your time, of course!

jakesarjeant commented 3 months ago

Please don't ever feel under pressure to respond quickly! Take your time, of course!

It's really no problem, I'm just out right now so I only have my phone to work with. I just want to do my best to cooperate with your investigation, especially since it seems reasonably likely that I'm the one at fault here, and I don't want to waste more maintainer resources than I need to.