kek / sublime-expand-selection-to-quotes

Sublime Text plugin to expand selection to surrounding quotes
107 stars 13 forks source link

Update to work with Python 3/Sublime Text 3 #6

Closed JohnArcher closed 11 years ago

JohnArcher commented 11 years ago

Updates the file for Python 3, so it runs with Sublime Text 3.

Not sure whether there is a better way than explicitly converting all_before and all_after to lists ...!? But that works.

mattfordham commented 11 years ago

This worked great for me. Thanks!

JohnArcher commented 11 years ago

Great to read! Your welcome!

kek commented 11 years ago

Thanks! I had tried to do a conversion of the code to be Python 3-compatible, but not commited it yet. But your way is better. The way I did it was to replace map and filter with loops and indexes because I didn't really understand how they changed those functions. Seems that in Python 3 map/filter return iterators where in Python 2 they just returned lists?

I also commited a small change that seems to make the same code work with Sublime Text 2.

JohnArcher commented 11 years ago

Thanks, @kek ! Well, yeah, they return iterators. But to be honest, I am no Python dev, I simply googled for the error message that was shown in Sublime console, and did the fix. :-)

Glad that you (hopefully) found a way to support v2 und v3 at the same time. Great!