1
1
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:
Tae Won Ha 2020-01-18 11:52:04 +01:00
parent 5fbc3e089d
commit dbec80fcf8
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
3 changed files with 8 additions and 13 deletions

View File

@ -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)
})

View File

@ -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;

View File

@ -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];