commit 10f2baa

Hubert Hirtz  ·  2020-11-13 11:14:23 +0000 UTC
parent 2313198
Move editor view when completing text
1 files changed,  +6, -0
+6, -0
 1@@ -229,6 +229,12 @@ func (e *Editor) AutoComplete() (ok bool) {
 2 	e.cursorIdx = e.autoCache[e.autoCacheIdx].CursorIdx
 3 	e.computeTextWidth()
 4 	e.autoCacheIdx = (e.autoCacheIdx + 1) % len(e.autoCache)
 5+	if len(e.textWidth) <= e.offsetIdx {
 6+		e.offsetIdx = 0
 7+	}
 8+	for e.width < e.textWidth[e.cursorIdx]-e.textWidth[e.offsetIdx]+16 {
 9+		e.offsetIdx++
10+	}
11 
12 	return true
13 }