graarh / sublime-AutoPHPDollar

Type the variable name without "$", and this plugin add it.
GNU General Public License v3.0
20 stars 3 forks source link

Sublime Text 3 support added #8

Open balaclark opened 10 years ago

balaclark commented 10 years ago

I've tweaked the plugin for Python 3 and Sublime Text 3 support. Only a few small changes were needed (use native "set()" and migrate from using "view.begin_edit()" to using a "sublime_plugin.TextCommand".

This plugin will now work on both Sublime Text 2 & 3.

hkdobrev commented 10 years ago

+1

ST3 support would be much appreciated.

@graarh Would you consider this?

hkdobrev commented 10 years ago

@balaclark I have an exception when checking out this PR.

Here it is:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 279, in on_modified_async
    callback.on_modified_async(v)
  File "~/Library/Application Support/Sublime Text 3/Packages/AutoPHPDollar/AutoPHPDollar.py", line 159, in on_modified_async
    auto_dollar(view)
  File "~/Library/Application Support/Sublime Text 3/Packages/AutoPHPDollar/AutoPHPDollar.py", line 113, in auto_dollar
    patterns = get_patterns(view)
  File "~/Library/Application Support/Sublime Text 3/Packages/AutoPHPDollar/AutoPHPDollar.py", line 40, in get_patterns
    + "(?=[^\w^\d])",
  File "~/Library/Application Support/Sublime Text 3/Packages/AutoPHPDollar/AutoPHPDollar.py", line 67, in find_variables
    if text in ignore_names:
TypeError: argument of type 'NoneType' is not iterable

I am using Sublime Text build 3061 on Mac OS X 10.9.

hkdobrev commented 10 years ago

I think the problem is that Sublime Text 3 is not allowing you to do sublime.load_settings() synchronously.