'Converts indentation to spaces respecting Vim settings.'

def indent_to_spaces(self, indent):

    indent = indent.expandtabs(self._tabstop)
    right = ((len(indent) - len(indent.rstrip('    '))) * '    ')
    indent = indent.replace('    ', '')
    indent = indent.replace(' DCTB ', ('    ' * self._tabstop))
    return (indent + right)
