From 8f5f8ffdd6a711fc6350ebd9a425077c159e2c52 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Mon, 10 Oct 2016 21:44:16 -0400 Subject: [PATCH] Fix tabstop sizing with mix of tabs and spaces Fixes #404 --- cmd/micro/actions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index d6d0dbc3..94177dca 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -687,7 +687,7 @@ func (v *View) InsertTab(usePlugin bool) bool { // Insert a tab if v.Buf.Settings["tabstospaces"].(bool) { tabSize := int(v.Buf.Settings["tabsize"].(float64)) - if remainder := v.Cursor.Loc.X % tabSize; remainder != 0 { + if remainder := v.Cursor.GetVisualX() % tabSize; remainder != 0 { tabSize = tabSize - remainder } v.Buf.Insert(v.Cursor.Loc, Spaces(tabSize))