diff --git a/internal/action/infocomplete.go b/internal/action/infocomplete.go index aeca99005d..b8ee879a30 100644 --- a/internal/action/infocomplete.go +++ b/internal/action/infocomplete.go @@ -135,15 +135,6 @@ headerLoop: return chosen, suggestions } -func contains(s []string, e string) bool { - for _, a := range s { - if a == e { - return true - } - } - return false -} - // OptionComplete autocompletes options func OptionComplete(b *buffer.Buffer) ([]string, []string) { c := b.GetActiveCursor() diff --git a/internal/buffer/line_array.go b/internal/buffer/line_array.go index 7906524ae9..b65213b805 100644 --- a/internal/buffer/line_array.go +++ b/internal/buffer/line_array.go @@ -285,11 +285,6 @@ func (la *LineArray) deleteLines(y1, y2 int) { la.lines = la.lines[:y1+copy(la.lines[y1:], la.lines[y2+1:])] } -// DeleteByte deletes the byte at a position -func (la *LineArray) deleteByte(pos Loc) { - la.lines[pos.Y].data = la.lines[pos.Y].data[:pos.X+copy(la.lines[pos.Y].data[pos.X:], la.lines[pos.Y].data[pos.X+1:])] -} - // Substr returns the string representation between two locations func (la *LineArray) Substr(start, end Loc) []byte { startX := runeToByteIndex(start.X, la.lines[start.Y].data) diff --git a/internal/config/plugin.go b/internal/config/plugin.go index 6c5c154115..200b2f541b 100644 --- a/internal/config/plugin.go +++ b/internal/config/plugin.go @@ -143,15 +143,3 @@ func FindPlugin(name string) *Plugin { } return pl } - -// FindAnyPlugin does not require the plugin to be enabled -func FindAnyPlugin(name string) *Plugin { - var pl *Plugin - for _, p := range Plugins { - if p.Name == name { - pl = p - break - } - } - return pl -} diff --git a/internal/config/rtfiles.go b/internal/config/rtfiles.go index 24adaebfa7..7a34d32462 100644 --- a/internal/config/rtfiles.go +++ b/internal/config/rtfiles.go @@ -62,12 +62,6 @@ type realFile string // some asset file type assetFile string -// some file on filesystem but with a different name -type namedFile struct { - realFile - name string -} - // a file with the data stored in memory type memoryFile struct { name string @@ -99,10 +93,6 @@ func (af assetFile) Data() ([]byte, error) { return rt.Asset(string(af)) } -func (nf namedFile) Name() string { - return nf.name -} - // AddRuntimeFile registers a file for the given filetype func AddRuntimeFile(fileType RTFiletype, file RuntimeFile) { allFiles[fileType] = append(allFiles[fileType], file) diff --git a/internal/util/util.go b/internal/util/util.go index 83dc4458ad..c2349f6c09 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -233,18 +233,6 @@ func IsNonWordChar(r rune) bool { return !IsWordChar(r) } -// IsUpperWordChar returns whether or not a rune is an 'upper word character' -// Upper word characters are defined as numbers, upper-case letters or sub-word delimiters -func IsUpperWordChar(r rune) bool { - return IsUpperAlphanumeric(r) || IsSubwordDelimiter(r) -} - -// IsLowerWordChar returns whether or not a rune is a 'lower word character' -// Lower word characters are defined as numbers, lower-case letters or sub-word delimiters -func IsLowerWordChar(r rune) bool { - return IsLowerAlphanumeric(r) || IsSubwordDelimiter(r) -} - // IsSubwordDelimiter returns whether or not a rune is a 'sub-word delimiter character' // i.e. is considered a part of the word and is used as a delimiter between sub-words of the word. // For now the only sub-word delimiter character is '_'. @@ -510,11 +498,6 @@ func IsAutocomplete(c rune) bool { return c == '.' || IsWordChar(c) } -// ParseSpecial replaces escaped ts with '\t'. -func ParseSpecial(s string) string { - return strings.ReplaceAll(s, "\\t", "\t") -} - // String converts a byte array to a string (for lua plugins) func String(s []byte) string { return string(s) diff --git a/pkg/highlight/highlighter.go b/pkg/highlight/highlighter.go index ebcd2aaa76..5af97edc84 100644 --- a/pkg/highlight/highlighter.go +++ b/pkg/highlight/highlighter.go @@ -51,19 +51,6 @@ func runePos(p int, str []byte) int { return CharacterCount(str[:p]) } -func combineLineMatch(src, dst LineMatch) LineMatch { - for k, v := range src { - if g, ok := dst[k]; ok { - if g == 0 { - dst[k] = v - } - } else { - dst[k] = v - } - } - return dst -} - // A State represents the region at the end of a line type State *region