Skip to content

Commit b881bf5

Browse files
authored
Remove unused internal or unexported functions (zyedidia#3481)
1 parent c8eeb78 commit b881bf5

File tree

6 files changed

+0
-66
lines changed

6 files changed

+0
-66
lines changed

internal/action/infocomplete.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,6 @@ headerLoop:
135135
return chosen, suggestions
136136
}
137137

138-
func contains(s []string, e string) bool {
139-
for _, a := range s {
140-
if a == e {
141-
return true
142-
}
143-
}
144-
return false
145-
}
146-
147138
// OptionComplete autocompletes options
148139
func OptionComplete(b *buffer.Buffer) ([]string, []string) {
149140
c := b.GetActiveCursor()

internal/buffer/line_array.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,6 @@ func (la *LineArray) deleteLines(y1, y2 int) {
285285
la.lines = la.lines[:y1+copy(la.lines[y1:], la.lines[y2+1:])]
286286
}
287287

288-
// DeleteByte deletes the byte at a position
289-
func (la *LineArray) deleteByte(pos Loc) {
290-
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:])]
291-
}
292-
293288
// Substr returns the string representation between two locations
294289
func (la *LineArray) Substr(start, end Loc) []byte {
295290
startX := runeToByteIndex(start.X, la.lines[start.Y].data)

internal/config/plugin.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,3 @@ func FindPlugin(name string) *Plugin {
143143
}
144144
return pl
145145
}
146-
147-
// FindAnyPlugin does not require the plugin to be enabled
148-
func FindAnyPlugin(name string) *Plugin {
149-
var pl *Plugin
150-
for _, p := range Plugins {
151-
if p.Name == name {
152-
pl = p
153-
break
154-
}
155-
}
156-
return pl
157-
}

internal/config/rtfiles.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ type realFile string
6262
// some asset file
6363
type assetFile string
6464

65-
// some file on filesystem but with a different name
66-
type namedFile struct {
67-
realFile
68-
name string
69-
}
70-
7165
// a file with the data stored in memory
7266
type memoryFile struct {
7367
name string
@@ -99,10 +93,6 @@ func (af assetFile) Data() ([]byte, error) {
9993
return rt.Asset(string(af))
10094
}
10195

102-
func (nf namedFile) Name() string {
103-
return nf.name
104-
}
105-
10696
// AddRuntimeFile registers a file for the given filetype
10797
func AddRuntimeFile(fileType RTFiletype, file RuntimeFile) {
10898
allFiles[fileType] = append(allFiles[fileType], file)

internal/util/util.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,6 @@ func IsNonWordChar(r rune) bool {
233233
return !IsWordChar(r)
234234
}
235235

236-
// IsUpperWordChar returns whether or not a rune is an 'upper word character'
237-
// Upper word characters are defined as numbers, upper-case letters or sub-word delimiters
238-
func IsUpperWordChar(r rune) bool {
239-
return IsUpperAlphanumeric(r) || IsSubwordDelimiter(r)
240-
}
241-
242-
// IsLowerWordChar returns whether or not a rune is a 'lower word character'
243-
// Lower word characters are defined as numbers, lower-case letters or sub-word delimiters
244-
func IsLowerWordChar(r rune) bool {
245-
return IsLowerAlphanumeric(r) || IsSubwordDelimiter(r)
246-
}
247-
248236
// IsSubwordDelimiter returns whether or not a rune is a 'sub-word delimiter character'
249237
// i.e. is considered a part of the word and is used as a delimiter between sub-words of the word.
250238
// For now the only sub-word delimiter character is '_'.
@@ -510,11 +498,6 @@ func IsAutocomplete(c rune) bool {
510498
return c == '.' || IsWordChar(c)
511499
}
512500

513-
// ParseSpecial replaces escaped ts with '\t'.
514-
func ParseSpecial(s string) string {
515-
return strings.ReplaceAll(s, "\\t", "\t")
516-
}
517-
518501
// String converts a byte array to a string (for lua plugins)
519502
func String(s []byte) string {
520503
return string(s)

pkg/highlight/highlighter.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ func runePos(p int, str []byte) int {
5151
return CharacterCount(str[:p])
5252
}
5353

54-
func combineLineMatch(src, dst LineMatch) LineMatch {
55-
for k, v := range src {
56-
if g, ok := dst[k]; ok {
57-
if g == 0 {
58-
dst[k] = v
59-
}
60-
} else {
61-
dst[k] = v
62-
}
63-
}
64-
return dst
65-
}
66-
6754
// A State represents the region at the end of a line
6855
type State *region
6956

0 commit comments

Comments
 (0)