mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 22:07:09 +09:00
Fix tabstospaces problem
This commit is contained in:
@@ -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++ {
|
||||
|
||||
@@ -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`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user