MCPcopy
hub / github.com/SirVer/ultisnips / indent_to_spaces

Method indent_to_spaces

pythonx/UltiSnips/indent_util.py:28–34  ·  view source on GitHub ↗

Converts indentation to spaces respecting Vim settings.

(self, indent)

Source from the content-addressed store, hash-verified

26 return self.spaces_to_indent(line_ind)
27
28 def indent_to_spaces(self, indent):
29 """Converts indentation to spaces respecting Vim settings."""
30 indent = indent.expandtabs(self._tabstop)
31 right = (len(indent) - len(indent.rstrip(" "))) * " "
32 indent = indent.replace(" ", "")
33 indent = indent.replace("\t", " " * self._tabstop)
34 return indent + right
35
36 def spaces_to_indent(self, indent):
37 """Converts spaces to proper indentation respecting Vim settings."""

Callers 3

_updateMethod · 0.95
__init__Method · 0.80

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected