Hi,
Yakov Lerner wrote:
> On 4/11/06, Anatoli Sakhnik <[EMAIL PROTECTED]> wrote:
>> Hello!
>> Can anyone tell me what's wrong in the following function. I select
>> something, press \/, enter _graph on the prompt and get another prompt
>> immediately...
>>
>> function! VisualRangeSearch(flags)
>> let pat = input("'<,'>/")
>> let s = '\%V'.pat
>> call search(s, a:flags)
>> endf
>>
>> vnoremap <Leader>/ :call VisualRangeSearch('')
>> vnoremap <Leader>? :call VisualRangeSearch('b')
>
> Something strange is going on here.
> I simplified the testcase to 1 liner:
>
> vnoremap \\ :call input(line('.').col('.').'>>>')<cr>
>
> If you visual-select multiple lines and press \\,
> you'll see that input() is called multiple times, once
> for each selected line. Strange.
for an explanation see
:help a:firstline
and
:help function-range-example
Regards,
Jürgen
--
Jürgen Krämer Softwareentwicklung
HABEL GmbH & Co. KG mailto:[EMAIL PROTECTED]
Hinteres Öschle 2 Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-Weilheim Fax: +49 / 74 61 / 93 53 - 99