ranges

package
v0.0.0-...-c88107b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineRange

type LineRange struct {
	Begin int
	End   int
}

LineRange represents the range of selected lines

func (*LineRange) String

func (r *LineRange) String() string

type Range

type Range struct {
	Sel []*LineRange
	// contains filtered or unexported fields
}

Range maintains the list of ranges

func New

func New(s string) *Range

New returns a new range object from string representation of ranges

func (*Range) AddRange

func (r *Range) AddRange(begin, end int)

AddRange adds a selection range potentially consolidating other ranges

func (*Range) AddSelPoint

func (r *Range) AddSelPoint(end int)

AddSelPoint adds selection between previous selection point and the one provided (to be used with Shift+clicking to select ranges with the mouse)

func (*Range) ClearSelection

func (r *Range) ClearSelection()

ClearSelection clears selection

func (*Range) HasSelection

func (r *Range) HasSelection() bool

HasSelection returns true if there's some selection

func (*Range) IsLineSelected

func (r *Range) IsLineSelected(n int) bool

IsLineSelected returns true if the line number is in any of the selection ranges

func (*Range) IsOnlyLineSelected

func (r *Range) IsOnlyLineSelected(n int) bool

IsOnlyLineSelected returns true if the line number is the only line selected

func (*Range) Parse

func (r *Range) Parse(s string) error

Parse parses string representation of ranges

func (*Range) RemoveRange

func (r *Range) RemoveRange(begin, end int)

RemoveRange removes selection range potentially breaking apart or adjusting other ranges

func (*Range) SetRange

func (r *Range) SetRange(begin, end int)

SetRange resets the selection with one given range

func (*Range) String

func (r *Range) String() string

String generates the string representation of the Range object

func (*Range) ToggleLine

func (r *Range) ToggleLine(n int)

ToggleLine either adds or removes the line from selection

Jump to

Keyboard shortcuts

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