catch AttributeError when self.view.file_name() is None (new unsaved files)
Merge pull request #16 from tconst/fix_dirname_nil

catch AttributeError when self.view.file_name() is None