Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTextWidth = 80 DefaultTabWidth = 4 DefaultMaxWrap = 20 DefaultMaxIndentRetain = 40 DefaultWrapIndicator = "\u21aa" // '↪' - rightwards arrow with hook )
View Source
const MinSoftWrapWidth = 10
Variables ¶
View Source
var ErrInvalidAutoPairConfig = errors.New("invalid auto-pair config")
Functions ¶
func DetectLanguage ¶
Types ¶
type AutoPairConfig ¶
func (*AutoPairConfig) UnmarshalTOML ¶
func (a *AutoPairConfig) UnmarshalTOML(value any) error
type Grammar ¶
type Grammar struct {
Name string
Source GrammarSource
}
type GrammarSelection ¶
type Language ¶
type Language struct {
TextWidth *int `toml:"text-width"`
Name string `toml:"name"`
LanguageID string `toml:"language-id"`
Scope string `toml:"scope"`
InjectionRegex string `toml:"injection-regex"`
FileTypes []FileType
Shebangs []string `toml:"shebangs"`
Roots []string `toml:"roots"`
LanguageServers []ServerFeatures
CommentTokens []string
BlockCommentTokens []core.BlockCommentToken
Indent Indent
AutoPairs AutoPairConfig
AutoFormat bool `toml:"auto-format"`
Formatter *Formatter
SoftWrap SoftWrap `toml:"soft-wrap"`
Rulers []int `toml:"rulers"`
}
func LoadLanguage ¶
type Languages ¶
type Languages struct {
Languages []Language
LanguageServers map[string]Server
GrammarSelection GrammarSelection
Grammars []Grammar
}
func LoadBundledLanguages ¶
type ServerFeatures ¶
type ServerFeatures struct {
Name string
}
type TextFormat ¶
type TextFormat struct {
ViewportWidth int
TabWidth int
SoftWrap bool
MaxWrap int
MaxIndentRetain int
WrapIndicator string
SoftWrapAtTextWidth bool
}
func DefaultTextFormat ¶
func DefaultTextFormat(w int) *TextFormat
func TextFormatForConfig ¶
func TextFormatForConfig( lang *Language, textWidth *int, softWrap SoftWrap, w int, ) *TextFormat
func (*TextFormat) WrapIndicatorPrefix ¶ added in v0.1.19
func (t *TextFormat) WrapIndicatorPrefix() string
WrapIndicatorPrefix is the indicator plus its gap, as drawn at the start of a soft-wrapped continuation row
Click to show internal directories.
Click to hide internal directories.