Closed JulienPalard closed 6 months ago
OK this looks almost OK to me.
Few things are not OK though:
The try
/ tryelse
don't expand correctly, they "indent", is it due to my setup?
The files contains:
# -*- mode: snippet -*-
# name: try
# key: try
# --
try:
$0
except ${1:Exception}:
$2
and
# -*- mode: snippet -*-
# name: tryelse
# key: tryelse
# --
try:
$0
except $1:
$2
else:
$3
It gives:
try:
except Exception:
and:
try:
except :
else:
also for the "newlines at end of file" is that common to add them or not add them? I spotted that when there's a newline at end of file it also get inputed in the file, so the behavior is different, I hope there's an existing concensus on this?
@AndreaCrotti gentle ping
Oh my indentation issue has to do with the last lines of .yas-setup.yml:
(add-hook 'python-mode-hook #'yasnippet-snippets--fixed-indent)
and the way I test my snippets. I was testing them by just symlinking ~/.emacs.d/snippets/ to my clone, haha.
What is the proper way to run yasnippet-snippets from my clone instead of elpa?
I was able to test it properly using:
(use-package yasnippet-snippets
:load-path "~/clones/yasnippet-snippets"
)
I checked ans yes, yasnippet-snippets--fixed-indent
do runs. but in my Python buffer the yas-indent-line
is still auto
.
Using # expand-env: ((yas-indent-line 'fixed))
in the individual snippet that need it works though.
OK for me everything now works as expected.
Is there something I can do here?
A follow up of #278.
I tried to keep it simple, not much elisp, only simple additions.
I did not tested it yet, I'd like to test it a bit before merging.
It's my very first contribution to this repo so beware :D