From f0c4a82b8823c9034ea34aec4126a986d31c7de2 Mon Sep 17 00:00:00 2001 From: bloeys Date: Sun, 27 Feb 2022 10:42:08 +0400 Subject: [PATCH] Correct offset with tabs --- editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.go b/editor.go index ae6f8e5..ac631a7 100755 --- a/editor.go +++ b/editor.go @@ -85,7 +85,7 @@ func (e *Editor) Render(drawStartPos, winSize *imgui.Vec2) { maxCol := len(eee.chars) - 1 if tabCount > 0 { - maxCol += clampInt(tabCount*settings.TabSize-1, 0, math.MaxInt) + maxCol += clampInt(tabCount*settings.TabSize, 0, math.MaxInt) } finalCol := clampInt(clickedCol+tabChars, 0, maxCol) if len(eee.chars) > 0 && finalCol > 0 {