summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-08-05 21:40:16 +0200
committerBram Moolenaar <Bram@vim.org>2010-08-05 21:40:16 +0200
commit84f888a5b3640dffdff1ecd1e19e4ba6aa3ed6af (patch)
tree03d50c34b873780c1373257497bd046eac25f044
parent74cbdf0334ffadf335082990464719e12cef22d3 (diff)
Fix a few problems for :find completion. Test much more. (Nazri Ramliy)
-rw-r--r--runtime/doc/todo.txt8
-rw-r--r--src/ex_getln.c13
-rw-r--r--src/misc1.c2
-rw-r--r--src/testdir/test73.in84
-rw-r--r--src/testdir/test73.ok8
5 files changed, 102 insertions, 13 deletions
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index a42e8f3d14..5113840f12 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.3e. Last change: 2010 Aug 04
+*todo.txt* For Vim version 7.3e. Last change: 2010 Aug 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -33,8 +33,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
Before release 7.3:
- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
-test73 doesn't work on MS-Windows.
-
Better Czech keymap. (Stepnem, 2010 May 4) Use if no response from Jiri
Tobisek.
@@ -54,6 +52,8 @@ Should readfile() ignore BOM when not in binary mode?
Bug: searching for tags file uses 'suffixesadd', should not happen. (Dominique
Pelle, 2010 June 28)
+Bug: E685 error for func_unref(). (ZyX, 2010 Aug 5)
+
When directory "/tmp/tags" contains "tags1" and "tags2", setting 'tags' to
"/tmp/tags/*" doesn't pick up these files. (Simon Ruggier, 2010 Mar 17)
@@ -257,6 +257,8 @@ There should be a way after an abbreviation has expanded to go back to what
was typed. CTRL-G h ? Would also undo last word or line break inserted
perhaps. And undo CTRL-W. CTRL-G l would redo.
+Diff mode out of sync. (Gary Johnson, 2010 Aug 4)
+
Win32: A --remote command that has a directory name starting with a ( doesn't
work, the backslash is removed, assuming that it escapes the (. (Valery
Kondakoff, 2009 May 13)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 790d5315a0..8a18a4cce7 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -5045,15 +5045,16 @@ globpath(path, file, expand_options)
{
/* Copy one item of the path to buf[] and concatenate the file name. */
copy_option_part(&path, buf, MAXPATHL, ",");
- if (path_with_url(buf))
- continue;
- /*
- * FIXME: should we proactively skip 'path' with limiter (/usr/ **N)
- * and upward search (;) notations, just like we did with url above?
- */
if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL)
{
+# ifdef WIN3264
+ /* Using the platform's path separator (\) makes vim incorrectly
+ * treat it as an escape character, use '/' instead. */
+ if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf)))
+ STRCAT(buf, "/");
+# else
add_pathsep(buf);
+# endif
STRCAT(buf, file);
if (ExpandFromContext(&xpc, buf, &num_p, &p,
WILD_SILENT|expand_options) != FAIL && num_p > 0)
diff --git a/src/misc1.c b/src/misc1.c
index c8fb8eb3fa..ef7c10c5e9 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9337,6 +9337,8 @@ expand_path_option(curdir, gap)
}
else if (buf[0] == NUL) /* relative to current directory */
STRCPY(buf, curdir);
+ else if (path_with_url(buf))
+ continue;
else if (!mch_isFullName(buf))
{
/* Expand relative path to their full path equivalent */
diff --git a/src/testdir/test73.in b/src/testdir/test73.in
index 8928aeb2d6..706c379e7c 100644
--- a/src/testdir/test73.in
+++ b/src/testdir/test73.in
@@ -1,23 +1,99 @@
Tests for find completion.
STARTTEST
+:" Do all test in a separate window to avoid E211 when we recursively
+:" delete the Xfind directory during cleanup
+:"
+:" This will cause a few errors, do it silently.
+:set visualbell
+:"
+:function! DeleteDirectory(dir)
+: if has("win16") || has("win32") || has("win64")
+: exec "silent !rmdir /Q /S " . a:dir
+: else
+: exec "silent !rm -rf " . a:dir
+: endif
+:endfun
+:" On windows a stale "Xfind" directory may exist, remove it so that
+:" we start from a clean state.
+:call DeleteDirectory("Xfind")
+:set nocp
+:new
+:let cwd=getcwd()
:!mkdir Xfind
-:!mkdir Xfind/in
-:!mkdir Xfind/in/path
+:cd Xfind
+:set path=
+:find
+:w! ../test.out
+:close
+:new
+:set path=.
+:find
+:w >>../test.out
+:close
+:new
+:set path=.,,
+:find
+:w >>../test.out
+:close
+:new
+:set path=./**
+:find
+:w >>../test.out
+:close
+:new
+:" We shouldn't find any file at this point, ../test.out must be empty.
+:!mkdir in
+:cd in
+:!mkdir path
+:exec "cd " . cwd
:e Xfind/file.txt
SHoly Grail:w
:e Xfind/in/file.txt
SJimmy Hoffa:w
+:e Xfind/in/stuff.txt
+SAnother Holy Grail:w
:e Xfind/in/path/file.txt
SE.T.:w
:set path=Xfind/**
-:set nocp
:find file
-:w! test.out
+:w >> test.out
+:find file
+:w >>test.out
+:find file
+:w >>test.out
+:" Rerun the previous three find completions, using fullpath in 'path'
+:exec "set path=" . cwd . "/Xfind/**"
+:find file
+:w >> test.out
:find file
:w >>test.out
:find file
:w >>test.out
+:" Same steps again, using relative and fullpath items that point to the same
+:" recursive location.
+:" This is to test that there are no duplicates in the completion list.
+:exec "set path+=Xfind/**"
+:find file
+:w >> test.out
+:find file
+:w >>test.out
+:find file
+:w >>test.out
+:find file
+:" Test find completion for directory of current buffer, which at this point
+:" is Xfind/in/file.txt.
+:set path=.
+:find st
+:w >> test.out
+:" Test find completion for empty path item ",," which is the current directory
+:cd Xfind
+:set path=,,
+:find f
+:w >> ../test.out
+:cd ..
+:q
+:call DeleteDirectory("Xfind")
:qa!
ENDTEST
diff --git a/src/testdir/test73.ok b/src/testdir/test73.ok
index bf1d43359c..cd787f23a3 100644
--- a/src/testdir/test73.ok
+++ b/src/testdir/test73.ok
@@ -1,3 +1,11 @@
Holy Grail
Jimmy Hoffa
E.T.
+Holy Grail
+Jimmy Hoffa
+E.T.
+Holy Grail
+Jimmy Hoffa
+E.T.
+Another Holy Grail
+Holy Grail