def windowTitleForDocumentDisplayName_(self, name): editor = self.window_.current_editor if editor is not None: if editor.file_path is not None: return short_path(editor.file_path, editor) return editor.name or name return name
def test(input, output, editor=make_editor(os.path.join(home, "project"))): eq_(mod.short_path(input, editor), output)
def path_link(path, editor): return "[{rel}](xt://open/{path})".format( rel=short_path(path, editor), path=quote(path), )