Permalink
Browse files

Match full path only if search text includes slash

  • Loading branch information...
1 parent 5a2be39 commit 2e00ed2f68a5a2ae6a6d9725ffb7dfde6c858d84 @sickill committed Jun 1, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 ruby/command-t/match.c
View
@@ -48,6 +48,13 @@ VALUE CommandTMatch_initialize(int argc, VALUE *argv, VALUE self)
int dot_search = 0; // true if abbrev definitely matches a dot-file
int pending_dot_search = 0; // true if abbrev might match a dot-file
+ if (strchr(abbrev_p, '/') == NULL) {
+ char *filename = strrchr(str_p, '/');
+ if (filename != NULL) {
+ cursor = filename + 1 - str_p;
+ }
+ }
+
rb_iv_set(self, "@str", str);
VALUE offsets = rb_ary_new();

0 comments on commit 2e00ed2

Please sign in to comment.