capitaomorte/yasnippet — Issue #204: Fails when snippet file is a DOS text file (CRLF endings)
Author: oscarfv
Created: 2011-12-15 15:10:29+00:00
State: open

When expanding a snippet which file is CRLF-ended, the expansion misses the last line:

---- Sample Snippet ----
# -*- mode: snippet -*-
# name: for-each
# key: fe
# --
(for-each (${1:id} $2)
$0)
---- End Sample Snippet ----

Save the above snippet on a file with DOS line-endings. Please note that there is no newline after the `$0)'. Start a new Emacs session and try to expand the snippet. This is the result:

(for-each (id )

Note how the last `)' is missing. If the snippet is explicity evaluated (yas/visit-snippets, C-c C-c) it works fine.

The same snippet, when saved with unix line-endings, works as expected.

I'm using revision dc7a640.