zedit

package
v0.0.0-...-7229e34 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditorCell

type EditorCell struct {
	Rune  rune
	Flags bitset.BitSet
}

EditorCell represents a rune and arbitrary many flags which are associated with tags in a Tags container. This is a memory-efficient storage of tags over regions, though not as memory-efficient as intervals. A previous implementation used an interval tree and a different tag system but it turned out to be too complex for handling editing operation.

type EditorFlag

type EditorFlag uint

EditorFlag is a numerical key associated with a tag.

type TagMap

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

TagMap is a concurrent store with flags as key and tags as values.

func NewTagMap

func NewTagMap() *TagMap

NewTagMap returns a new, empty Tags container.

func (*TagMap) Get

func (c *TagMap) Get(flag EditorFlag) (Tag, bool)

Get returns a single tag and true for a given flag, false when there is no tag for the flag as key.

func (*TagMap) GetAll

func (c *TagMap) GetAll(flags []EditorFlag) []Tag

GetAll returns all tags associated with the given flags. If there is no corresponding mapping, then no tag is added.

func (*TagMap) Remove

func (c *TagMap) Remove(flag EditorFlag)

Remove deletes the tag for the given flag.

func (*TagMap) Set

func (c *TagMap) Set(flag EditorFlag, tag Tag)

Set associates a flag with a tag in the container.

Jump to

Keyboard shortcuts

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