sources

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sources

type Sources struct {
	Unicode unicode.Unicode
	Vim     VimData
}

Sources encapsulates all the sources of data we use for various lookups.

func NewAll

func NewAll() *Sources

NewAll gives us a Sources item which has had loaded all the data sources that we know about.

func NewEmpty

func NewEmpty() *Sources

NewEmpty gives us a Sources item with no data loaded.

func (*Sources) LoadUnicode

func (s *Sources) LoadUnicode() *Sources

LoadUnicode gives us static information about Unicode data sources.

func (*Sources) LoadVim

func (s *Sources) LoadVim() *Sources

LoadVim gives us dynamically-loaded data about vim digraphs, retrieved by invoking vim. Will handle vim not being installed (but will print errors; we'll probably change this in the future).

func (*Sources) LoadVimAgain added in v0.0.2

func (s *Sources) LoadVimAgain() *Sources

LoadVimAgain avoids the cache so that data is loaded from Vim again

type VimData

type VimData struct {
	DigraphByRune map[rune][]VimDigraph
}

VimData is the set of all data we have retrieved about characters from vim.

func (VimData) DigraphsFor

func (v VimData) DigraphsFor(r rune) string

DigraphsFor retrieves a string which is a space-separated list of the known digraph sequences which will produce a given rune.

type VimDigraph

type VimDigraph struct {
	Sequence  string
	Result    rune
	Codepoint int
}

VimDigraph encapsulates a vim digraph sequence, which is an input tuple of keypresses which together result in a rune. After typing "Ctrl-K", you might enter "Pd" to get "£".

Jump to

Keyboard shortcuts

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