mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-14 03:35:49 -07:00
Implement --toggle-sort option (#173)
This commit is contained in:
@@ -54,17 +54,21 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We can uniquely identify the pattern for a given string since
|
||||
// mode and caseMode do not change while the program is running
|
||||
_patternCache = make(map[string]*Pattern)
|
||||
_splitRegex = regexp.MustCompile("\\s+")
|
||||
_cache = NewChunkCache()
|
||||
clearPatternCache()
|
||||
clearChunkCache()
|
||||
}
|
||||
|
||||
func clearPatternCache() {
|
||||
// We can uniquely identify the pattern for a given string since
|
||||
// mode and caseMode do not change while the program is running
|
||||
_patternCache = make(map[string]*Pattern)
|
||||
}
|
||||
|
||||
func clearChunkCache() {
|
||||
_cache = NewChunkCache()
|
||||
}
|
||||
|
||||
// BuildPattern builds Pattern object from the given arguments
|
||||
func BuildPattern(mode Mode, caseMode Case,
|
||||
nth []Range, delimiter *regexp.Regexp, runes []rune) *Pattern {
|
||||
|
Reference in New Issue
Block a user