util

package
v0.0.0-...-ea6e25d Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Provides necessary models for the application.

Index

Constants

View Source
const APP_NAME = "Notepad--"

Variables

This section is empty.

Functions

func GetTemporaryTitle

func GetTemporaryTitle(content string) string

Used to generate a temporary title if no file was used

Types

type AppState

type AppState struct {
	AppName           string
	Filename          string
	FileModified      bool
	Screen            tcell.Screen
	TextBuffer        textbuffer.TextBuffer
	BarStyle          tcell.Style
	TextboxStyle      tcell.Style
	ButtonStyle       tcell.Style
	ButtonActiveStyle tcell.Style
	Options           Options
}

func InitialiseAppState

func InitialiseAppState(screen tcell.Screen, filename string, options Options) *AppState

func (*AppState) Save

func (appstate *AppState) Save() error

Saves the current textbuffer to disk. An error is returned if the save was unsuccessful. Note that saving an unmodified file is considered a "success".

type Options

type Options struct {
	LineEndMode string
	Encoding    string
	WordWrap    bool
}

Options for Notepad--

func (*Options) LE

func (opt *Options) LE() string

Returns the line-end character.

func (*Options) LineEndModeString

func (opt *Options) LineEndModeString() string

Jump to

Keyboard shortcuts

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