Documentation ¶
Index ¶
- Constants
- func Split(s []rune, sep rune) (r [][]rune)
- func SplitByLF(s []byte) (results [][]byte)
- type Action
- type ActionClass
- type ActionGroup
- type Cursor
- type Encoder
- type File
- func (r *File) AddRow(data []byte)
- func (r *File) AddToRow(index int, b []byte) bool
- func (ff *File) Backup() error
- func (ff *File) ChangePath(path string)
- func (r *File) Clear()
- func (r *File) DecodeEndRune(rowIndex int) (ch rune, size, colIndex int, ok bool)
- func (r *File) DecodePrevRune(rowIndex int, colIndex int) (ch rune, size, i int, ok bool)
- func (r *File) DecodeRune(rowIndex int, colIndex int) (ch rune, size int, ok bool)
- func (ff *File) GetBase() string
- func (ff *File) GetClass() string
- func (r *File) GetColLength(rowIndex int) (int, bool)
- func (ff *File) GetDispPath() string
- func (ff *File) GetEncoding() string
- func (ff *File) GetLinefeed() string
- func (ff *File) GetPath() string
- func (ff *File) GetRegion(cursor1, cursor2 Cursor) *[]byte
- func (r *File) GetRow(index int) (*row, bool)
- func (ff *File) GetTabWidth() int
- func (r *File) InsertRow(rowIndex int, newRow []byte) bool
- func (r *File) InsertToCol(rowIndex int, insertIndex int, data []byte) bool
- func (ff *File) IsDirtyFlag() bool
- func (ff *File) IsReadonly() bool
- func (r *File) IsRowIndexLastRow(rowIndex int) bool
- func (ff *File) Load() error
- func (ff *File) New() error
- func (ff *File) RemoveRegion(cursor1, cursor2 Cursor) *[]byte
- func (r *File) RemoveRow(rowIndex int) bool
- func (r *File) RowLength() int
- func (ff *File) Rows() *rows
- func (ff *File) Save() error
- func (ff *File) SetPath(path string)
- func (ff *File) SetReadonly(b bool)
- func (r *File) SetRow(rowIndex int, row []byte) bool
- func (r *File) String(rowIndex int) (string, bool)
Constants ¶
View Source
const ( READONLY flags = 1 << iota LF linefeed = 1 << iota CRLF CR )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionClass ¶
type ActionClass int
const ( INSERT ActionClass = iota DELETE DELETE_BACKWARD ACTION_SEPARATOR )
type ActionGroup ¶
type ActionGroup []Action
func NewActionGroup ¶
func NewActionGroup() *ActionGroup
func (*ActionGroup) IsEmpty ¶
func (ag *ActionGroup) IsEmpty() bool
func (*ActionGroup) MoveTo ¶
func (undo *ActionGroup) MoveTo(redo *ActionGroup)
This bad function Move Undo ActionGroup to RedoActionGroup
func (*ActionGroup) Pop ¶
func (ag *ActionGroup) Pop() (lastAction Action, _ bool)
try before isUndoEmpty() method
func (*ActionGroup) Push ¶
func (ag *ActionGroup) Push(a Action)
type Cursor ¶
func (*Cursor) AdjustForDeletion ¶
adjustCursorForDeletion updates the cursor position to reflect the deleted text within the buffer.
func (*Cursor) AdjustForInsertion ¶
adjustCursorForInsertion updates the cursor position to reflect the inserted text within the buffer.
type File ¶
type File struct { LangMode *lang.Mode TabWidth int SoftTab bool UndoAction *ActionGroup RedoAction *ActionGroup // contains filtered or unexported fields }
func (*File) AddRow ¶
func (r *File) AddRow(data []byte)
AddRow adds a new []byte to the lines **slices**
func (*File) ChangePath ¶
func (*File) DecodeEndRune ¶
func (*File) DecodePrevRune ¶
DecodePrevRune decodes the previous rune from the specified line and position i: colIndex
func (*File) DecodeRune ¶
DecodeRune decodes a rune from the specified line and position
func (*File) GetColLength ¶
GetColLength returns the length of a specific []byte by index
func (*File) GetDispPath ¶
func (*File) GetEncoding ¶
func (*File) GetLinefeed ¶
func (*File) GetTabWidth ¶
func (*File) InsertToCol ¶
InsertToCol inserts a byte slice into a specific line at the specified position
func (*File) IsDirtyFlag ¶
func (*File) IsReadonly ¶
func (*File) IsRowIndexLastRow ¶
func (*File) RemoveRegion ¶
No undo/redo functionality
func (*File) SetReadonly ¶
Click to show internal directories.
Click to hide internal directories.