VcsGutter icon indicating copy to clipboard operation
VcsGutter copied to clipboard

view.filename()

Open Phaiax opened this issue 11 years ago • 0 comments

Hey

This is a bug which has been reported for ArcticTypescript here. https://github.com/Phaiax/ArcticTypescript/issues/12

ArcticTypescript creates views without associated file

>>> import sublime
>>> myview = sublime.active_window().new_file()
>>> myview
<sublime.View object at 0x7fdbe8cee510>
>>> myview.file_name() is None
True

So this code from VcsGutter will fail:

@classmethod
def vcs_tree(cls, view):
"""Returns the directory at the top of the tree that contains
the file in the passed Sublime view."""
full_file_path = view.file_name()
file_parent_dir = os.path.realpath(os.path.dirname(full_file_path))
return cls.vcs_root(file_parent_dir)

Phaiax avatar Jan 14 '15 16:01 Phaiax