Documentation ¶
Index ¶
Constants ¶
View Source
const ( CONFIG_DIR_PATH = "/.phi-editor/" CONFIG_TOML_FILE = "config.toml" )
Variables ¶
View Source
var CONFIG_FULL_PATH string = ""
this is the absolute path to the config.toml file. todo rename/refactor
View Source
var DEFUALT_TOML_CONFIG = `` /* 1600-byte string literal not displayed */
View Source
var DefaultSyntaxSet = DefaultSyntax{}
View Source
var FONT_FOLDER string = ""
View Source
var ICON_DIR_PATH string = ""
View Source
var Shortcuts = &shortcutRegister{ Supers: map[string]string{}, Controls: map[string]string{}, }
Functions ¶
func RegisterSyntax ¶
Types ¶
type CursorConfig ¶
type CursorConfig struct { Flash_Rate int64 Reset_Delay int64 Draw bool Flash bool Block_Width string }
func (CursorConfig) GetCaretWidth ¶
func (c CursorConfig) GetCaretWidth() int
type DefaultSyntax ¶
type EditorConfig ¶
type FileAssociations ¶
type FileAssociations struct {
Extensions []string
}
type LanguageSyntaxConfig ¶
type LanguageSyntaxConfig struct {
Syntax map[string]*SyntaxCriteria `toml:"syntax"`
}
type PaletteConfig ¶ added in v0.1.1
type RenderConfig ¶
type SyntaxCriteria ¶
type ThemeConfig ¶
type ThemeConfig struct { Background uint32 Foreground uint32 Cursor uint32 Cursor_Invert uint32 Palette PaletteConfig Gutter_Background uint32 Gutter_Foreground uint32 Highlight_Line_Background uint32 }
todo make this more extendable... e.g. .phi-editor/themes with TOML themes in them and we can select the default theme in the EditorConfig instead.
type TomlConfig ¶
type TomlConfig struct { Editor EditorConfig `toml:"editor"` Cursor CursorConfig `toml:"cursor"` Render RenderConfig `toml:"render"` Theme ThemeConfig `toml:"theme"` Associations map[string]FileAssociations `toml:"file_associations"` Commands map[string]Command `toml:"commands"` // contains filtered or unexported fields }
func NewDefaultConfig ¶
func NewDefaultConfig() *TomlConfig
func Setup ¶
func Setup() TomlConfig
func (*TomlConfig) GetSyntaxConfig ¶
func (t *TomlConfig) GetSyntaxConfig(ext string) (*LanguageSyntaxConfig, error)
GetSyntaxConfig returns a pointer to the parsed syntax language file for the given file extension e.g. what syntax def we need for a .cpp file or a .h file
Click to show internal directories.
Click to hide internal directories.