From 9d0433ba028792f5a468507dba28d406b9f758e7 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 2 Nov 2022 19:58:20 -0400 Subject: fixed path-specific settings bugs. stuff seems to be working now --- buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index d7e3062..036398b 100644 --- a/buffer.c +++ b/buffer.c @@ -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; -- cgit v1.2.3