Expose CharacterCount to plugins

This commit is contained in:
Zachary Yedidia
2020-05-20 18:04:00 -04:00
parent 5c8a2332d9
commit 9a22d93ea2
3 changed files with 3 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ function onRune(bp, r)
if r == charAt(autoclosePairs[i], 1) then
local curLine = bp.Buf:Line(bp.Cursor.Y)
if bp.Cursor.X == utf8.RuneCountInString(curLine) or not uutil.IsWordChar(charAt(curLine, bp.Cursor.X+1)) then
if bp.Cursor.X == uutil.CharacterCountInString(curLine) or not uutil.IsWordChar(charAt(curLine, bp.Cursor.X+1)) then
-- the '-' here is to derefence the pointer to bp.Cursor.Loc which is automatically made
-- when converting go structs to lua
-- It needs to be dereferenced because the function expects a non pointer struct