zsong / diffy

A sublime plugin to show difference between 2 files. It supports both Sublime 2 and 3.
MIT License
51 stars 6 forks source link

Fails to work on Mac OS X 10.9 #3

Closed emlama closed 9 years ago

emlama commented 10 years ago

This plugin isn't working on my machine. Looking into the ST2 console I see this error:

Reloading plugin /Users/matthew/Library/Application Support/Sublime Text 2/Packages/Diffy/diffy.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./diffy.py", line 3, in <module>
    from .diffy_lib import diffier
ValueError: Attempted relative import in non-package
zsong commented 10 years ago

Thanks for reporting and I will look into this.

emlama commented 10 years ago

Thanks! I was able to get this working with an older (1.0.1??) version.

Great plugin, I love being able to do diff in my editor.

On Tuesday, July 22, 2014, Ziang Song notifications@github.com wrote:

Thanks for reporting and I will look into this.

— Reply to this email directly or view it on GitHub https://github.com/zsong/diffy/issues/3#issuecomment-49828931.

-Matthew

gabriensymons commented 10 years ago

I also tried to install Diffy in Sublime Text 2 and saw the same error as matthewforr.

SimonMGarrett commented 10 years ago

Yes, same for me on OS X 10.9.

As matthewforr said, there's an import error (has 10.9 moved things around? For me, diffier.py is in .../Sublime\ Text\ 2/Packages/Diffy/diffy_lib, yet 'from .diffy_lib import diffier' can't find it). As a result, the key bindings:

[ { "keys": ["super+k", "super+d"], "command": "diffy" } { "keys": ["super+k", "super+c"], "command": "diffy", "args": {"action": "clear"} } ]

don't work because diffy doesn't exist.

SimonMGarrett commented 10 years ago

Without saying this will ensure full functionality, a fix is to put empty init .py files [that's underscore-underscore-init-underscore-underscore but this textbox I'm typing in treats it like I'm emphasising the word init!] in the Diffy directory and its diffy_lib subdirectory, then to change line 3 of diffy.py from:

from .diffy_lib import diffier

to:

from diffy_lib import diffier

(delete the dot). Then open the console (View/Show Console) and type "import diffy" and press return.

You probably don't really need to do the final import, but it does force-start Diffy.

zsong commented 9 years ago

Fixed. Please update to the latest version.