3 // LuaRuneAt is a helper function for lua plugins to return the rune
4 // at an index within a string
5 func LuaRuneAt(str string, runeidx int) string {
8 r, _, size := DecodeCharacterInString(str)
21 // LuaGetLeadingWhitespace returns the leading whitespace of a string (used by lua plugins)
22 func LuaGetLeadingWhitespace(s string) string {
25 r, _, size := DecodeCharacterInString(s)
26 if r == ' ' || r == '\t' {
27 ws = append(ws, byte(r))
37 // LuaIsWordChar returns true if the first rune in a string is a word character
38 func LuaIsWordChar(s string) bool {
39 r, _, _ := DecodeCharacterInString(s)