Permalink
Browse files

Downcase abbrev when doing fuzzy matching.

Fixes bug where uppercase characters matched nothing.
  • Loading branch information...
1 parent b39e2aa commit 582e889c47d465652bd055311e0b669e58e8ae73 @vatic42 vatic42 committed Sep 28, 2010
Showing with 3 additions and 3 deletions.
  1. +1 −2 plugin/lusty-explorer.vim
  2. +1 −1 src/mercury.rb
  3. +1 −0 src/mercury_test.rb
@@ -154,7 +154,6 @@
" - uppercase character should make matching case-sensitive
" - FilesystemGrep
" - C-jhkl navigation to highlight a file?
-" - abbrev "a" should score e.g. "ad" higher than "m-a"
" Exit quickly when already loaded.
if exists("g:loaded_lustyexplorer")
@@ -573,7 +572,7 @@ class Mercury
def initialize(string, abbrev)
@string = string
@lower_string = string.downcase()
- @abbrev = abbrev
+ @abbrev = abbrev.downcase()
@level = 0
@branches = 0
end
View
@@ -26,7 +26,7 @@ def score()
def initialize(string, abbrev)
@string = string
@lower_string = string.downcase()
- @abbrev = abbrev
+ @abbrev = abbrev.downcase()
@level = 0
@branches = 0
end
View
@@ -142,3 +142,4 @@ def test(high_entry, low_entry, abbrev)
test("tent.txt", "tablet-executor-node.h", "ten")
test("tent.txt", "tablet-executor-node.h", "te")
test("ad", "m-a", "a")
+test("a", "b", "A")

0 comments on commit 582e889

Please sign in to comment.