Comments (9)
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.
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.
Ok, I think that @ljli has fixed this. Can you verify that those changes are good?
from nix-mode.
Seems to mostly work, thanks!
from nix-mode.
Awesome!
from nix-mode.
Not so fast :). "${null}" asdf
messes up (string literal doesn't end). Adding a character between }
and "
fixes.
from nix-mode.
See https://github.com/matthewbauer/nix-mode/pull/13#issuecomment-289954158
from nix-mode.
Err, I am testing on latest master.
from nix-mode.
Worked! Thanks, and sorry for missing that.
from nix-mode.
Related Issues (20)
- Incorrect highlighting for ending quote after antiquote
- Request: Custom face for variable names inside antiquote braces
- error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override HOT 1
- nix-eshell doesn't play well with flake.nix HOT 2
- List of nix builtins HOT 4
- Incorrect highlighting when an secaped $ not followed by { in indented strings
- 'point' is an obsolete HOT 1
- Latest tagged version doesn't work with Emacs 28+
- Add nix-browse-installable
- Support completing `.#` in pcomplete/nix (ex. nix build .#myconfig`) HOT 4
- Support fenced code blocks via multiple modes HOT 3
- New dependency on reformatter not reflected in melpa recipe HOT 2
- Send input to nix repl? HOT 2
- nix-eshell does not work HOT 2
- get warnings from nix-mode
- org-babel-tangle-file failed with nix-mode HOT 1
- prefill an example flake on `C-x C-f flake.nix` HOT 1
- NixOS RFC 166 - Formatter Rules
- Feature request: command for block commenting
- `''\x` not highlighted correctly in intended string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-mode.