def run(self, group=-1, index=-1):
        """Rename the given tab."""

        if group >= 0 and index >= 0:
            view = get_group_view(self.window, group, index)
            if view is not None:
                file_name = view.file_name()
                if file_name is not None and exists(file_name):
                    branch, leaf = split(file_name)
                    v = self.window.show_input_panel(
                        "New Name:", leaf,
                        functools.partial(self.on_done, file_name, branch),
                        None, None
                    )
                    name = splitext(leaf)[0]
                    v.sel().clear()
                    v.sel().add(sublime.Region(0, len(name)))
dataset/ETHPy150Open facelessuser/TabsExtra/tabs_extra.py/TabsExtraRenameCommand.run/original