Skip to content

view.filename() #31

@Phaiax

Description

@Phaiax

Hey

This is a bug which has been reported for ArcticTypescript here.
Phaiax/ArcticTypescript#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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions