Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused internal or unexported functions #3481

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions internal/action/infocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 0 additions & 5 deletions internal/buffer/line_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions internal/config/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
10 changes: 0 additions & 10 deletions internal/config/rtfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -99,10 +93,6 @@ func (af assetFile) Data() ([]byte, error) {
return rt.Asset(string(af))
}

func (nf namedFile) Name() string {
alexandear marked this conversation as resolved.
Show resolved Hide resolved
return nf.name
}

// AddRuntimeFile registers a file for the given filetype
func AddRuntimeFile(fileType RTFiletype, file RuntimeFile) {
allFiles[fileType] = append(allFiles[fileType], file)
Expand Down
17 changes: 0 additions & 17 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
alexandear marked this conversation as resolved.
Show resolved Hide resolved

// 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 '_'.
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions pkg/highlight/highlighter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down