'Show the selected item.'

def show_selection(self):

    selected = self.selection()
    selection.selection_model().set_selection(selected)
    self.update_actions(selected=selected)
    selected_indexes = self.selected_indexes()
    if (not selected_indexes):
        if self.m.amending():
            cmds.do(cmds.SetDiffText, u'')
        else:
            cmds.do(cmds.ResetMode)
        return
    (category, idx) = selected_indexes[0]
    if (category == self.idx_header):
        cls = {self.idx_staged: cmds.DiffStagedSummary, self.idx_modified: cmds.Diffstat, self.idx_untracked: cmds.UntrackedSummary}.get(idx, cmds.Diffstat)
        cmds.do(cls)
    elif (category == self.idx_staged):
        item = self.staged_items()[0]
        cmds.do(cmds.DiffStaged, item.path, deleted=item.deleted)
    elif (category == self.idx_modified):
        item = self.modified_items()[0]
        cmds.do(cmds.Diff, item.path, deleted=item.deleted)
    elif (category == self.idx_unmerged):
        item = self.unmerged_items()[0]
        cmds.do(cmds.Diff, item.path)
    elif (category == self.idx_untracked):
        item = self.unstaged_items()[0]
        cmds.do(cmds.ShowUntracked, item.path)
