Documentation
¶
Index ¶
- Constants
- type Buffer
- func (b *Buffer) ChangeLetterCaseTo(Case cases.Case, isVisualLine bool)
- func (b *Buffer) ClearLine()
- func (b *Buffer) CopyLine(l *Line, startOffset int, endOffset int) *copied
- func (b *Buffer) CopySelected(isDelete bool, isVisualLine bool)
- func (b *Buffer) DelAndMoveLine()
- func (b *Buffer) DelAndMoveLineAt(startLine int, endLine int, endOffset int)
- func (b *Buffer) DeleteUntilSpace()
- func (b *Buffer) Delkey()
- func (b *Buffer) DismissList() bool
- func (b *Buffer) EscapeToNormal()
- func (b *Buffer) FindBeforeNext(ch rune)
- func (b *Buffer) FindBeforePrev(ch rune)
- func (b *Buffer) FindNext(ch rune)
- func (b *Buffer) FindPrev(ch rune)
- func (b *Buffer) FixOffset()
- func (b *Buffer) H(amount int)
- func (b *Buffer) InsertEmptyLine(lineShift int)
- func (b *Buffer) InsertKey(key rune)
- func (b *Buffer) InsertLine()
- func (b *Buffer) InsertLineWithData(index int, data []rune)
- func (b *Buffer) InsertPair(key rune)
- func (b *Buffer) Insert_a()
- func (b *Buffer) J(amount int)
- func (b *Buffer) K(amount int)
- func (b *Buffer) L(amount int)
- func (b *Buffer) MoveBACK(amount int)
- func (b *Buffer) MoveBack(amount int)
- func (b *Buffer) MoveEND(amount int)
- func (b *Buffer) MoveEnd(amount int)
- func (b *Buffer) MoveToFirstChar()
- func (b *Buffer) MoveToFirstLine()
- func (b *Buffer) MoveToFirstVisible()
- func (b *Buffer) MoveToLastChar()
- func (b *Buffer) MoveToLastLine()
- func (b *Buffer) MoveWORD(amount int)
- func (b *Buffer) MoveWord(amount int)
- func (b *Buffer) Paste(shift int)
- func (b *Buffer) Redo() error
- func (b *Buffer) RemoveKey()
- func (b *Buffer) RemoveLine()
- func (b *Buffer) RemoveLineAt(lineIndex int)
- func (b *Buffer) ReplaceKeys(key rune, amount int)
- func (b *Buffer) ResetKeepOffset()
- func (b *Buffer) SaveChanges(op operation, start int, end int, with_prev bool)
- func (b *Buffer) SaveCopied()
- func (b *Buffer) ShiftLineLeft(amount int)
- func (b *Buffer) ShiftLineRight(amount int)
- func (b *Buffer) StartVisual()
- func (b *Buffer) StartVisualLine()
- func (b *Buffer) SwapTail()
- func (b *Buffer) Undo() error
- type Line
Constants ¶
const ( Insert operation Change Delete )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
Title string
Copies []*copied
Lines []*Line
Cursor *cursor
Visual *cursor
UndoStack []snapshot
RedoStack []snapshot
IsReadOnly bool
Type buffers.BufferType
// contains filtered or unexported fields
}
Title - name of the oppened file pairs - used like a stask to keep track of paired brackets copies - sores copied lines Lines - List of lines Cursor - read pos of cursor UndoStack - stores list of snapshots. Used to move 'back in time' in file history Visual - anchor point for real cursor pos, used to calculate selected area in visual and visual-line modes IsReadOnly - ised to check if oppened file could be change IsMdFile - if file extations is not '.md', bard uses default reader instead of markdown one
func InitBuffer ¶
func InitBuffer() []*Buffer
func (*Buffer) ChangeLetterCaseTo ¶
func (*Buffer) CopySelected ¶
copies selected area into [copied], betven [Cursor] and [Visual] points
func (*Buffer) DelAndMoveLine ¶
func (b *Buffer) DelAndMoveLine()
Called when the user deletes the 0th character in a line. The line is deleted and data is moved to the line above
func (*Buffer) DelAndMoveLineAt ¶
func (*Buffer) DeleteUntilSpace ¶
func (b *Buffer) DeleteUntilSpace()
func (*Buffer) Delkey ¶
func (b *Buffer) Delkey()
Called when the user presses [x] or [s] in normal mode. It deletes the character and copies it to the buffer
func (*Buffer) DismissList ¶
func (*Buffer) EscapeToNormal ¶
func (b *Buffer) EscapeToNormal()
func (*Buffer) FindBeforeNext ¶
func (*Buffer) FindBeforePrev ¶
func (*Buffer) InsertEmptyLine ¶
func (*Buffer) InsertLine ¶
func (b *Buffer) InsertLine()
Called when the user presses [enter] in the middle of a line. This function shifts data from the right to the new line
func (*Buffer) InsertLineWithData ¶
func (*Buffer) InsertPair ¶
func (*Buffer) MoveToFirstChar ¶
func (b *Buffer) MoveToFirstChar()
func (*Buffer) MoveToFirstLine ¶
func (b *Buffer) MoveToFirstLine()
func (*Buffer) MoveToFirstVisible ¶
func (b *Buffer) MoveToFirstVisible()
Move buffer.Cursor to the first non-space character in the line
func (*Buffer) MoveToLastChar ¶
func (b *Buffer) MoveToLastChar()
func (*Buffer) MoveToLastLine ¶
func (b *Buffer) MoveToLastLine()
func (*Buffer) RemoveKey ¶
func (b *Buffer) RemoveKey()
Called when the user presses [backspace] and just removes the character in front of it
func (*Buffer) RemoveLineAt ¶
Delete the whole line at index
func (*Buffer) ReplaceKeys ¶
func (*Buffer) ResetKeepOffset ¶
func (b *Buffer) ResetKeepOffset()
func (*Buffer) SaveChanges ¶
func (*Buffer) SaveCopied ¶
func (b *Buffer) SaveCopied()
func (*Buffer) ShiftLineLeft ¶
func (*Buffer) ShiftLineRight ¶
func (*Buffer) StartVisual ¶
func (b *Buffer) StartVisual()
func (*Buffer) StartVisualLine ¶
func (b *Buffer) StartVisualLine()