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

Do indenting before expanding #19

Closed
joaotavora opened this issue Nov 3, 2011 · 4 comments
Closed

Do indenting before expanding #19

joaotavora opened this issue Nov 3, 2011 · 4 comments
Assignees

Comments

@joaotavora
Copy link
Owner

Add a variable (buffer local) to control the behavior of optionally doing
indenting before expands a snippet.

Google Code Info:
Issue #: 16
Author: plus...@gmail.com
Created On: 2008-03-26T04:55:26.000Z
Closed On: 2008-09-02T13:07:52.000Z

@ghost ghost assigned joaotavora Nov 3, 2011
@joaotavora
Copy link
Owner Author

I think it would be a good idea to add a control sequence like "$>" to allow the user
to control indentation in their snippet definitions. A per buffer variable is not
flexible enough. Also 'indent-according-to-mode' is the only sane way to do
indentation -- I work on several different projects at a time, they all have varying
coding styles, so blindly inserting tabs and spaces will not work.

Google Code Info:
Author: lbs...@gmail.com
Created On: 2008-08-27T11:33:29.000Z

@joaotavora
Copy link
Owner Author

Yes, I know your requests. I'm also missing the "$>" feature from smart-snippet.
However, "$>" in smart-snippet doesn't really work well sometimes. For example, in
python-mode, indent-according-to-mode will make the overlays into garbage. But, in
fact, it works in most cases. The main reason I didn't add this feature to YASnippet
for such a long time might be that I didn't found a better solution. But, there are
so much users miss it, maybe it is still worth implementing it in YASnippet despite
it doesn't work well in some modes.

Google Code Info:
Author: plus...@gmail.com
Created On: 2008-08-27T11:41:00.000Z

@joaotavora
Copy link
Owner Author

Oh, I see. But that most definitely is a bug in Python mode, so the better approach
is to file a bug report against python-mode, not limiting your features to cater to
other people's bugs. (I don't use python-mode, so...)

Google Code Info:
Author: lbs...@gmail.com
Created On: 2008-08-27T12:35:11.000Z

@joaotavora
Copy link
Owner Author

Fixed by adding $> support. Feel free to try it out by checking out the latest svn
version. Refer to
http://pluskid.lifegoo.com/upload/project/yasnippet/doc/define_snippet.html#indenting
for the document.

Google Code Info:
Author: plus...@gmail.com
Created On: 2008-09-02T13:07:52.000Z

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

1 participant