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

Adding StraightQuotes plugin #4223

Closed
wants to merge 2 commits into from
Closed

Adding StraightQuotes plugin #4223

wants to merge 2 commits into from

Conversation

dhirsch
Copy link

@dhirsch dhirsch commented Mar 17, 2015

My first plugin, so please let me know if there's anything wrong

@FichteFoll
Copy link
Collaborator

You have to push valid semantic version tags (with optional leading v) to your repo. They consist of three numeric parts.

Then, your package is very similar to MagiclessQuotes by @daryltucker, which you referenced. I suggest you work on a pull request and collaborate with @daryltucker on this because of that. I'm sure you can also work out why it didn't work for you previously (see end of my post).

By the way, your plugin doesn't work correctly. Test with multiple one-to-many replacements of the same type, e.g. multiple in your test file. It will become all messy. The reason for that is that by replacing content with view.replace you change the view's text extends and the previously returned regions from view.find_all are not updated with these changes. If you insert text before a region then it will shift by the difference of the previous to the new text.
Work around: Do replacements in reverse, that is for rgn in reversed(self.view.find_all(...)):. Magiclessquotes actually does that, even though differently.

@daryltucker, your self.view.end_edit(edit) line needs to go, that method doesn't exist in ST3 anymore. It doesn't affect funtionality since it's the very last line of the code, but it creates an ugly traceback in the console every time it is run. Your {1} in the regular expressions is also redundant since that's the default.

@daryltucker
Copy link
Contributor

@FichteFoll Thanks for fix!

@dhirsch Let me know if you want to get together, or let me know what MagiclessQuotes is missing for you!

daryltucker/MagiclessQuotes@acda27f

daryltucker added a commit to daryltucker/MagiclessQuotes that referenced this pull request Mar 19, 2015
@FichteFoll
Copy link
Collaborator

Closing since it seems you have gotten in touch on the MagiclessQuotes repo.

@FichteFoll FichteFoll closed this Apr 29, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants