Re: complete=custom for path including spaces

2007-03-15 Thread Raphael Bauduin

On 3/15/07, Bram Moolenaar <[EMAIL PROTECTED]> wrote:


Raphael Bauduin wrote:

> I'm writing a command with a custom completion, and it works fine,
> except when there's a space in the "path" to complete.
>
> For example, without spaces everything works:
>:Radiant edit pages/ho
> will complete to
>:Radiant edit pages/home/
> which I can further complete:
>:Radiant edit pages/home/fi
> to
>:Radiant edit pages/home/first-post/
>
> If there's a space, it doesn't work:
>:Radiant edit pages/Ho
> is completed to
>:Radiant edit pages/Home\ Page/
> But now, this
>:Radiant edit pages/Home\ Page/A
> doesn't complete it, although my completion function returns what is
> expected as completion:
>pages/Home\ Page/About
>pages/Home\ Page/Articles
>
> What am I missing here?

Did you try returning the matches without the backslash?


I'm 99% sure I tried it, but your question is seeding doubts :-)



You can also try using "customlist", then Vim will not filter the
results.  The backslash may confuse the filtering.


I did that indeed (but from further tests, the following approach
should also work when using custom in place of customlist), and only
return the part after the last space.  Eg, when completing
:Radiant pages/Home Page/A

the returned list is

["Page/About","Page/Articles"]


I'll post a notice  when I get a satisfying result.

Cheers

Raph

--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org


Re: complete=custom for path including spaces

2007-03-14 Thread Bram Moolenaar

Raphael Bauduin wrote:

> I'm writing a command with a custom completion, and it works fine,
> except when there's a space in the "path" to complete.
> 
> For example, without spaces everything works:
>:Radiant edit pages/ho
> will complete to
>:Radiant edit pages/home/
> which I can further complete:
>:Radiant edit pages/home/fi
> to
>:Radiant edit pages/home/first-post/
> 
> If there's a space, it doesn't work:
>:Radiant edit pages/Ho
> is completed to
>:Radiant edit pages/Home\ Page/
> But now, this
>:Radiant edit pages/Home\ Page/A
> doesn't complete it, although my completion function returns what is
> expected as completion:
>pages/Home\ Page/About
>pages/Home\ Page/Articles
> 
> What am I missing here?

Did you try returning the matches without the backslash?

You can also try using "customlist", then Vim will not filter the
results.  The backslash may confuse the filtering.

-- 
"A mouse can be just as dangerous as a bullet or a bomb."
 (US Representative Lamar Smith, R-Texas)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


complete=custom for path including spaces

2007-03-14 Thread Raphael Bauduin

Hi,

I'm writing a command with a custom completion, and it works fine,
except when there's a space in the "path" to complete.

For example, without spaces everything works:
  :Radiant edit pages/ho
will complete to
  :Radiant edit pages/home/
which I can further complete:
  :Radiant edit pages/home/fi
to
  :Radiant edit pages/home/first-post/

If there's a space, it doesn't work:
  :Radiant edit pages/Ho
is completed to
  :Radiant edit pages/Home\ Page/
But now, this
  :Radiant edit pages/Home\ Page/A
doesn't complete it, although my completion function returns what is
expected as completion:
  pages/Home\ Page/About
  pages/Home\ Page/Articles

What am I missing here?

Raph

--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org