nix-ts-mode icon indicating copy to clipboard operation
nix-ts-mode copied to clipboard

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

Open Atemu opened this issue 1 year ago • 2 comments

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:

  • Before "bin": ""bin"}/bin"
  • Inside "bin": "--bindir=${placeholder "bin""
  • After "bin": "--bindir=${placeholder "bin""

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

Atemu avatar Apr 24 '24 15:04 Atemu

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

peterhoeg avatar May 13 '24 11:05 peterhoeg

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.

Atemu avatar May 13 '24 12:05 Atemu