mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-26 23:36:08 +03:00
Make some fields static
This commit is contained in:
parent
5fbc3e089d
commit
dbec80fcf8
@ -260,10 +260,11 @@ class FileService {
|
||||
|
||||
if self.shouldStop() { return }
|
||||
|
||||
let scoreThreshold = FuzzyMatcher.minScore() + 1
|
||||
callback(files[start..<end].compactMap { file in
|
||||
let url = file.url!
|
||||
let score = matcher.score(matchFullPath ? url.path : url.lastPathComponent)
|
||||
if score <= matcher.minScore + 1 { return nil }
|
||||
if score <= scoreThreshold { return nil }
|
||||
|
||||
return ScoredUrl(url: url, score: score)
|
||||
})
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
@interface FuzzyMatcher : NSObject
|
||||
|
||||
@property (readonly) NSInteger maxPatternLength;
|
||||
@property (readonly) NSInteger maxTextLength;
|
||||
@property (readonly) NSInteger minScore;
|
||||
+ (NSInteger)maxPatternLength;
|
||||
+ (NSInteger)maxTextLength;
|
||||
+ (NSInteger)minScore;
|
||||
|
||||
- (instancetype _Nonnull)initWithPattern:(NSString * _Nonnull)pattern;
|
||||
- (NSInteger)score:(NSString * _Nonnull)text;
|
||||
|
@ -11,17 +11,11 @@
|
||||
ccls::FuzzyMatcher *_matcher;
|
||||
}
|
||||
|
||||
- (NSInteger)maxPatternLength {
|
||||
return ccls::FuzzyMatcher::kMaxPat;
|
||||
}
|
||||
+ (NSInteger)maxPatternLength {return ccls::FuzzyMatcher::kMaxPat;}
|
||||
|
||||
- (NSInteger)maxTextLength {
|
||||
return ccls::FuzzyMatcher::kMaxText;
|
||||
}
|
||||
+ (NSInteger)maxTextLength {return ccls::FuzzyMatcher::kMaxText;}
|
||||
|
||||
- (NSInteger)minScore {
|
||||
return ccls::FuzzyMatcher::kMinScore;
|
||||
}
|
||||
+ (NSInteger)minScore {return ccls::FuzzyMatcher::kMinScore;}
|
||||
|
||||
- (instancetype)initWithPattern:(NSString *)pattern {
|
||||
self = [super init];
|
||||
|
Loading…
Reference in New Issue
Block a user