"Compare Both" throws TypeError if run before "Set Left Side" has ever been used
What happens
easy_diff_basic.py keeps the left-hand comparison side in a module-level global:
LEFT = None
...
class EasyDiffCompareBothCommand(...):
def get_left(self):
if self.clipboard:
left = {...}
else:
left = LEFT
return left
and the top-level diff() function immediately does left["win_id"] on whatever get_left() returns. If "Compare Both" is run before "Set Left Side" has ever been used in the session (a plausible first-use mistake, or just picking the wrong menu item), LEFT is still None, and indexing into it throws:
TypeError: 'NoneType' object is not subscriptable
Repro steps
- Install EasyDiff (or restart Sublime with it installed, so
LEFTis freshlyNone). - Run "Compare Both" (not "Compare Left/Right", and without ever running "Set Left Side" first) on any file.
- The traceback above should appear.
This is based on a direct source read of easy_diff_basic.py (the code path is unambiguous: LEFT starts None, get_left() returns it unchanged, diff() indexes into it immediately) — a live capture of the exact traceback on this end was interrupted by an unrelated local environment issue, so please treat this as a strong, source-grounded report rather than an observed-live one, and let me know if it doesn't reproduce as described.
Suggested fix
Have EasyDiffCompareBothCommand.run() check LEFT is not None (or that get_left() returned something non-None) before calling diff(), and show a status message like "Set a left side first" otherwise — matching the existing is_enabled/panel_enable_check gating already used for the quick-panel menu entries.
Claude reports: closing this after 30 days with no response. Reopen it if it is still relevant.