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

auto run after # => #25

Open
JeanMertz opened this issue May 4, 2016 · 2 comments
Open

auto run after # => #25

JeanMertz opened this issue May 4, 2016 · 2 comments

Comments

@JeanMertz
Copy link

JeanMertz commented May 4, 2016

I have (I guess?) some plugin that allows me to type #<tab> and it shows up as # => in any Ruby document.

It would be great if seeing-is-believing would automatically detect this, and show the results.

Beats #<tab> <alt+cmd+N>

@JoshCheek
Copy link
Owner

Oh, yeah, that would be cool ^_^

If you do "command-." it will show you the keybinding resolver (again to turn it off), which will let you see what things are getting run as you type. In this case, it looks like the expansion functionality comes from a snippets library. Probably check if it supports a post-expansion callaback, then you can run SiB with xmpfilter style (only updates the markers)

@JoshCheek
Copy link
Owner

Thinking about it, I don't want to turn that on generally speaking, b/c I use it a lot where I don't want that feature (primarily while teaching / explaining, when I want to ask the question of what will appear before letting them see the answer) but it would be cool to offer it as an optional feature.

However, since it comes from another library that I don't want to add as a dependency I think it best to not do this, unless it is a small amount of code and can do some sort of feature detection so that it won't break for someone who uninstalls that snippets lib.

JoshCheek added a commit that referenced this issue Feb 4, 2017
Needs to be cleaned up, this was just to see if it is possible, which it is.
I'm committing it on a branch to maybe prompt consideration in the snippets package.
It seems like maybe the way to do this for real would be for the snippets package
to emit an event for did-expand-snippet. Though I don't fully grasp how all the
pieces fit together.

For context, see:
  #25
  atom/snippets#221
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

2 participants