note

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCopyLinesCommand

func ParseCopyLinesCommand(cmd string) (int, int, error)

Handles various formats: - co 1 2 (copy lines 1 to 2) - co 1 1 (copy line 1) - co 1 (copy line 1) - co 20 > 2 (copy lines 20 to 22) - co 20 < 2 (copy lines 18 to 20) - co 20 > -1 (copy lines 20 to the end) - co 20 < -1 (copy lines 1 to 20)

Types

type Note

type Note struct {
	Name      string
	Content   string
	CreatedAt time.Time
	UpdatedAt time.Time
	Byte      []byte
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Store

func (*Store) CopyContent

func (s *Store) CopyContent(content string) error

func (*Store) CopyLines

func (s *Store) CopyLines(content string, start, end int) (int, error)

func (*Store) Create

func (s *Store) Create(name, content string) error

func (*Store) Delete

func (s *Store) Delete(name string) error

func (*Store) DeleteCurrentNote

func (s *Store) DeleteCurrentNote() error

func (*Store) GetCurrentNote

func (s *Store) GetCurrentNote() (Note, bool)

func (Store) GetEditor

func (s Store) GetEditor() string

func (*Store) GetNote

func (s *Store) GetNote(name string) (Note, bool)

func (*Store) GetNoteByName

func (s *Store) GetNoteByName(name string) (Note, bool)

func (Store) GetNotePath

func (s Store) GetNotePath(name string) string

func (Store) GetStorage

func (s Store) GetStorage() string

func (Store) GetVLineEnabledByDefault

func (s Store) GetVLineEnabledByDefault() bool

func (*Store) IsFirstNote

func (s *Store) IsFirstNote() bool

used to determine if the note was updated externally which means that its position in the list might have changed

func (*Store) LoadNotes

func (s *Store) LoadNotes() ([]Note, error)

func (*Store) MustGetCurrentNote

func (s *Store) MustGetCurrentNote() Note

func (*Store) RenameCurrentNote

func (s *Store) RenameCurrentNote(newName string) (Note, error)

func (Store) RenameNote

func (s Store) RenameNote(currentName, newName string) (Note, error)

func (*Store) SetCurrentNoteName

func (s *Store) SetCurrentNoteName(name string)

func (Store) SetDefaultVLineStatus

func (s Store) SetDefaultVLineStatus(enabled bool) error

func (*Store) SetEditor

func (s *Store) SetEditor(editor string) error

Jump to

Keyboard shortcuts

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