use sts instead of sw for initial tabs

This commit is contained in:
rygwdn@gmail.com 2010-11-18 13:30:07 -04:00
parent c20c76be71
commit 23924c3249
3 changed files with 5 additions and 5 deletions

View File

@ -17,6 +17,8 @@ class IndentUtil(object):
self.et = (vim.eval("&expandtab") == "1")
self.ts = int(vim.eval("&ts"))
self.tab = self.sts or self.ts
def indent_to_spaces(self, indent):
""" Converts indentation to spaces respecting vim settings. """
indent = indent.replace(" " * self.ts, "\t")

View File

@ -359,7 +359,7 @@ class Snippet(object):
line_ind = ""
else:
line_ind = indent
line_ind += tabs * self._util.sw * " "
line_ind += tabs * self._util.tab * " "
line_ind = self._util.indent_to_spaces(line_ind)
line_ind = self._util.spaces_to_indent(line_ind)
v.append(line_ind + line[tabs:])

View File

@ -764,12 +764,10 @@ class TabStop_VimScriptInterpolation_SimpleExample(_VimTest):
#############
class _ExpandTabs(_VimTest):
def _options_on(self):
self.send(":set ts=3\n")
self.send(":set sw=3\n")
self.send(":set sts=3\n")
self.send(":set expandtab\n")
def _options_off(self):
self.send(":set ts=8\n")
self.send(":set sw=8\n")
self.send(":set sts=0\n")
self.send(":set noexpandtab\n")
class RecTabStopsWithExpandtab_SimpleExample_ECR(_ExpandTabs):