diff options
author | pommicket <pommicket@gmail.com> | 2022-11-02 19:58:20 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-11-02 19:58:20 -0400 |
commit | 9d0433ba028792f5a468507dba28d406b9f758e7 (patch) | |
tree | f83f5db4b4d6e54ef70c252f624b108d40978ac6 /buffer.c | |
parent | b070e5ce01c829bd101b1e0eda49f1e25d9d125c (diff) |
fixed path-specific settings bugs. stuff seems to be working now
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -277,13 +277,15 @@ static long context_score(const char *path, Language lang, const SettingsContext long score = 0; if (lang == context->language) { - score += 100000; + score += 10000; } if (context->path) { - int i; - for (i = 0; i < TED_PATH_MAX && path[i] == context->path[i]; ++i); - score += i; + if (path && str_has_prefix(path, context->path)) { + score += (long)strlen(context->path); + } else { + score -= 100000; + } } return score; |