Giter Site home page Giter Site logo

Comments (9)

matthewbauer avatar matthewbauer commented on June 30, 2024 1

Sorry, I wasn't clear:

I had the same problem that you are describing and it was fixed by running this:

(makunbound 'nix-mode-syntax-table)

And reloading the new nix-mode. The problem seems to be from having already loaded the earlier nix-mode that has the bad syntax table.

from nix-mode.

teh avatar teh commented on June 30, 2024

AFAICT there is no simple fix. What we'd need is antiquotation to have both the ( and the | property.

(defun nix-syntax-propertize-close-brace ()
  "Set syntax properties for close braces.
If a close brace `}' ends an antiquote, the next character begins a string."
  (let* ((start (match-beginning 0))
         (context (save-excursion (save-match-data (syntax-ppss start))))
         (open (nth 1 context)))

    (when open ;; a corresponding open-brace was found
      (when (get-text-property open 'nix-syntax-antiquote)
        (put-text-property start (+ 1 start)
                           'syntax-table (string-to-syntax "|"))
	(put-text-property start (+ 1 start)
			   'syntax-table (string-to-syntax ")"))
	(put-text-property start (+ 1 start)
			   'nix-syntax-antiquote t)))))

from nix-mode.

matthewbauer avatar matthewbauer commented on June 30, 2024

Ok, I think that @ljli has fixed this. Can you verify that those changes are good?

from nix-mode.

teh avatar teh commented on June 30, 2024

Seems to mostly work, thanks!

from nix-mode.

matthewbauer avatar matthewbauer commented on June 30, 2024

Awesome!

from nix-mode.

Ericson2314 avatar Ericson2314 commented on June 30, 2024

Not so fast :). "${null}" asdf messes up (string literal doesn't end). Adding a character between } and " fixes.

from nix-mode.

matthewbauer avatar matthewbauer commented on June 30, 2024

See https://github.com/matthewbauer/nix-mode/pull/13#issuecomment-289954158

from nix-mode.

Ericson2314 avatar Ericson2314 commented on June 30, 2024

Err, I am testing on latest master.

from nix-mode.

Ericson2314 avatar Ericson2314 commented on June 30, 2024

Worked! Thanks, and sorry for missing that.

from nix-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.