Fix tabstospaces problem

This commit is contained in:
Zachary Yedidia
2016-05-22 15:47:28 -04:00
parent 4cc85868d9
commit 6ece5bc41a
2 changed files with 3 additions and 3 deletions

View File

@@ -569,7 +569,7 @@ func (v *View) Backspace() bool {
// tab (tabSize number of spaces)
lineStart := v.Buf.Lines[v.Cursor.y][:v.Cursor.x]
tabSize := int(settings["tabsize"].(float64))
if settings["tabsToSpaces"].(bool) && IsSpaces(lineStart) && len(lineStart) != 0 && len(lineStart)%tabSize == 0 {
if settings["tabstospaces"].(bool) && IsSpaces(lineStart) && len(lineStart) != 0 && len(lineStart)%tabSize == 0 {
loc := v.Cursor.Loc()
v.Cursor.SetLoc(loc - tabSize)
cx, cy := v.Cursor.x, v.Cursor.y
@@ -610,7 +610,7 @@ func (v *View) InsertTab() bool {
v.Cursor.DeleteSelection()
v.Cursor.ResetSelection()
}
if settings["tabsToSpaces"].(bool) {
if settings["tabstospaces"].(bool) {
tabSize := int(settings["tabsize"].(float64))
v.Buf.Insert(v.Cursor.Loc(), Spaces(tabSize))
for i := 0; i < tabSize; i++ {

View File

@@ -190,7 +190,7 @@ Here are the options that you can set:
default value: `on`
* `tabsToSpaces`: use spaces instead of tabs
* `tabstospaces`: use spaces instead of tabs
default value: `off`