Documentation ¶
Index ¶
- type Increment
- type Position
- func (p Position) Between(p1, p2 Position) bool
- func (p1 Position) Blank(p2 Position) string
- func (p1 Position) Cmp(p2 Position) int
- func (p1 Position) Diff(p2 Position) Increment
- func (p1 Position) Eq(p2 Position) bool
- func (p1 Position) Ge(p2 Position) bool
- func (p1 Position) Gt(p2 Position) bool
- func (p Position) Increment(inc Increment) Position
- func (p Position) IncrementPosition(incLine, incColumn, incOffset int) Position
- func (p Position) IsValid() bool
- func (p1 Position) Le(p2 Position) bool
- func (p1 Position) Lt(p2 Position) bool
- func (p1 Position) Ne(p2 Position) bool
- func (p Position) Next(r rune) Position
- func (p Position) NextString(s string) Position
- func (p Position) Prev(r rune) Position
- func (p Position) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Position ¶
Position represents the position of a character in a file.
func (Position) Cmp ¶
Cmp compares 2 positions. It returns : - -1 if p1 before p2 - 1 if p1 after p2 - 0 otherwise
func (Position) Increment ¶
Increment returns a new position with line, column and offset incremented by the given increment.
func (Position) IncrementPosition ¶
IncrementPosition returns a new position with line, column and offset incremented by the given increments.
func (Position) IsValid ¶
IsValid returns true if the position is valid. To be valid, a position should have lines > 0 and columns/offset ≥ 0.
func (Position) NextString ¶
NextString returns the cursor position next to the given string.
Click to show internal directories.
Click to hide internal directories.