split

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: ISC Imports: 3 Imported by: 0

Documentation

Overview

Package split provides a simple string splitting utility for use with CompleteMessage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsIndexed added in v0.3.6

func ArgsIndexed(text string, offset int64) (args []string, argIndex int64)

ArgsIndexed converts text into a shellwords-split list of strings. This function roughly follows shell syntax, in that it works with a single space character in bytes. This means that implementations could use bytes, as long as it only works with characters within the ASCII range, assuming the source text is in UTF-8 (which it should, per Go specifications).

func SpaceIndexed

func SpaceIndexed(text string, offset int64) ([]string, int64)

SpaceIndexed returns a splitted string with the current index that CompleteMessage wants. The text is the entire input string and the offset is where the cursor currently is.

Types

type SplitFunc added in v0.3.6

type SplitFunc = func(text string, offset int64) ([]string, int64)

SplitFunc is the type that describes the two splitter functions, SpaceIndexed and ArgsIndexed.

Jump to

Keyboard shortcuts

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