Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yasnippet snippets never exit #116

Open
tdavis opened this issue Sep 19, 2013 · 7 comments
Open

Yasnippet snippets never exit #116

tdavis opened this issue Sep 19, 2013 · 7 comments

Comments

@tdavis
Copy link

tdavis commented Sep 19, 2013

It seems there's a bug with the yasnippet generation because snippets do not exit. Basically this means I need to call yas-exit-all-snippets after I'm done tabbing through and filling out each template or "bad things" happen (read-only text, TAB jumps back to the template regardless of point position, etc.)

@skybert
Copy link

skybert commented Sep 23, 2013

I have this problem too, so much that I have bound yas-exit-all-snippts to C-]. Wonder if this has anything to do with the yas version as it cannot be that the bug has always been there.

@tdavis
Copy link
Author

tdavis commented Sep 23, 2013

Yeah, I've had to bind it to a key as well. I poked around for a while and this really seems like an issue internal to yasnippet. I could get the most basic call to yas-expand-snippet (like, "${0}") to not close. And yet I don't notice this issue with file-based snippets, just this function.

@root42
Copy link

root42 commented Sep 24, 2013

Yup, I know this problem as well. Any solutions?

@fred-o
Copy link
Collaborator

fred-o commented Oct 14, 2013

I sometimes have weird problems with yasnippet expansion, but most of the time they work fine. What version of yasnippet are you running? I have the ELPA-installed one called yasnippet-20130505.2115.

@tdavis
Copy link
Author

tdavis commented Oct 15, 2013

I'm on 2013-10-14. In this version, I actually can't even get snippets with more than two fields to expand properly:

Debugger entered--Lisp error: (wrong-type-argument numberp nil)
zerop(nil)
yas--field-probably-deleted-p([cl-struct-yas--snippet ([cl-struct-yas--field nil #<marker at 1983 in JSONPObjectProvider.java> #<marker at 1984 in JSONPObjectProvider.java> nil nil nil t [cl-struct-yas--field nil #<marker at 1986 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> nil nil nil t [cl-struct-yas--field nil #<marker at 1987 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> #3 nil nil t [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]]]]] [cl-struct-yas--field nil #<marker at 1986 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> nil nil nil t [cl-struct-yas--field nil #<marker at 1987 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> #2 nil nil t [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]]]] [cl-struct-yas--field nil #<marker at 1987 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> [cl-struct-yas--field nil #<marker at 1986 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> nil nil nil t #2] nil nil t [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]]] [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]] [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]] [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]) nil 8 #<overlay from 1975 to 2053 in JSONPObjectProvider.java> [cl-struct-yas--field nil #<marker at 1986 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> nil nil nil t [cl-struct-yas--field nil #<marker at 1987 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> #1 nil nil t [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]]]] nil nil] [cl-struct-yas--field nil #<marker at 1987 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> [cl-struct-yas--field nil #<marker at 1986 in JSONPObjectProvider.java> #<marker at 1987 in JSONPObjectProvider.java> nil nil nil t #0] nil nil t [cl-struct-yas--field nil #<marker at 1989 in JSONPObjectProvider.java> #<marker at 2005 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2007 in JSONPObjectProvider.java> #<marker at 2031 in JSONPObjectProvider.java> nil nil nil nil [cl-struct-yas--field nil #<marker at 2033 in JSONPObjectProvider.java> #<marker at 2052 in JSONPObjectProvider.java> nil nil nil nil nil]]]])
#[(field) "� =?\205�

@Archenoth
Copy link

I had this issue with a few modes that use Yasnippet. (Regardless of version.)

I found out that this only happens for me when "yas-minor-mode" wasn't enabled in the buffer using some of Yasnippet's functionality.

Adding "(yas-global-mode)" to my .emacs fixed the issue permanently, but for those that don't want global Yasnippet, it would be a good idea to add "(yas-minor-mode)" to the hooks of any modes that use it.

So, something like "(add-hook 'eclim-mode-hook (lambda () (yas-minor-mode-on)))" in your .emacs should fix it for eclim.

@fred-o
Copy link
Collaborator

fred-o commented Feb 19, 2014

That could very well be the problem. I tried running without yas-minor-mode activated and thus was able to replicate the problem. I've added a check to make sure that yas-minor-mode is actually active before attempting any template expansions. Thanks, @Archenoth !

Please let me know if this solves the problem, guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants