From a1825308b823dd65da5ed8c94fbdbd8425e6a285 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 7 Feb 2005 23:48:51 +0000 Subject: Patch from Chris Jones to select exact case match when available. --- src/AutoComplete.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index adbd24d03..b4d14944f 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -170,6 +170,18 @@ void AutoComplete::Select(const char *word) { --pivot; } location = pivot; + if (ignoreCase) { + // Check for exact-case match + for (; pivot <= end; pivot++) { + lb->GetValue(pivot, item, maxItemLen); + if (!strncmp(word, item, lenWord)) { + location = pivot; + break; + } + if (CompareNCaseInsensitive(word, item, lenWord)) + break; + } + } } else if (cond < 0) { end = pivot - 1; } else if (cond > 0) { -- cgit v1.2.3