utils

package
v0.0.0-...-2ab8766 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TabstopLength = 8

TODO keep synched with editor/config.go/tabstopLength

Variables

View Source
var InvisibleRuneTable = []rune{
	'@',
	'A',
	'B',
	'C',
	'D',
	'E',
	'F',
	'G',
	'H',
	'I',
	'J',
	'K',
	'L',
	'M',
	'N',
	'O',
	'P',
	'Q',
	'R',
	'S',
	'T',
	'U',
	'V',
	'W',
	'X',
	'Y',
	'Z',
	'[',
	'\\',
	']',
	'^',
	'_',
}

Functions

func CloneByteSlice

func CloneByteSlice(s []byte) []byte

func GrowByteSlice

func GrowByteSlice(s []byte, desiredCap int) []byte

func IndexFirstNonSpace

func IndexFirstNonSpace(s []byte) int

func IndexLastNonSpace

func IndexLastNonSpace(s []byte) int

func InsertBytes

func InsertBytes(s []byte, offset int, data []byte) []byte

func IsWord

func IsWord(r rune) bool

func IterLines

func IterLines(data []byte, cb func([]byte))

Function will iterate 'data' contents, calling 'cb' on some data or on '\n', but never both. For example, given this data: "\n123\n123\n\n", it will call 'cb' 6 times: ['\n', '123', '\n', '123', '\n', '\n']

func IterWords

func IterWords(data []byte, cb func(word []byte))

func ParseCount

func ParseCount(s string) int

ParseCount parses action multiplier from a string.

func RuneAdvanceLen

func RuneAdvanceLen(r rune, pos int) int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL