nix-community / nix-ts-mode

An Emacs major mode for editing Nix expressions, powered by tree-sitter [maintainer=@remi-gelinas]
https://github.com/nix-community/nix-ts-mode
Other
49 stars 9 forks source link

String interpolations with `"` in them confuse evil inner detection #21

Open Atemu opened 4 months ago

Atemu commented 4 months ago

Consider the following snippet:

    (enableFeature withPixelutils "pixelutils")

    "--bindir=${placeholder "bin"}/bin"

Placing the cursor inside pixelutils and entering di" in evil-mode deletes everything inside the quotes as expected.

Doing the same with the cursor placed anywhere within the second string however has strange results:

I don't know what exact heuristics evil-mode uses to determine quotation boundaries but something is obviously awry.

peterhoeg commented 4 months ago

In all fairness, there are similar problems with nix-mode

Atemu commented 4 months ago

Yes indeed; one of my pet peeves. It's arguably worse in nix-mode though as it breaks quote detection in the entire file while nix-ts-mode only breaks it in strings that contain interpolation.

Still, it'd be great if tree-sitter could be leveraged to actually fix this.