Christian Brabandt wrote:
> Hi 'Suresh!
>
> On Di, 12 Jan 2016, 'Suresh Govindachar' via vim_use wrote:
>
>> On 1/12/2016 1:50 PM, Bram Moolenaar wrote [indicating need to send
>> files archived in a format netrw can read, which isn't .7z]
>>
>> Summary:  The following reproducible steps work as expected on
>> 7.4.0, but cause 7.4.1023 to go into an infinite loop!
>>
>> Setup:  Windows 7, 64 bit
>>         cd <some_path>
>>         dir will show folders vim74 and vimfiles:
>>         vim74\[gvim.exe and other stuff]
>>         vimfiles\[contains only 3 files, all named notes.vim, in
>> attached zip]
>>            vimfiles/autoload/notes.vim
>>            vimfiles/ftplugin/notes.vim
>>            vimfiles/syntax/notes.vim
>>
>> Command: start vim74/gvim.exe -V20  -u none -U NONE
>>
>> Actions:  :find <path to file try_loading_me.txt, in attached zip]
>>           :set filetype=notes
>>           :source vimfiles\ftplugin\notes.vim
>>
>> Expected result -- seen in 7.4.0:  try_loading_me.txt will have folds
>>
>> Bug in 7.4.1023:  :source goes into infinite loop and never gets
>> back to user.
>>
>> Thanks for investigating this,
> You have a problem with your autoload script:
>
>    while(textm =~ '^\s*$')  " will always exit from while
>        if cline < i
>            break
>        endif
>        let i = i + 1
>        let textm = getline(cline-i)
>    endwhile
>
> There is no exit condition, once cline-i is smaller than 1.
> In that case getline returns an empty string, which happens to match 
> your "^\s*$" and therefore the loop happily continues.
> Therefore add an extra condition like this:
>
>    while(textm =~ '^\s*$')  " will always exit from while
>        if cline < i
>            break
>        endif
>        let i = i + 1
>        let textm = getline(cline-i)
>    endwhile
>
>
> Not sure, why this doesn't happen with the old gvim.exe
>
For those who were wondering -- the problematic autoload script fragment
did not have the

  if cline < i
     break
  endif

in it -- that's Christian's "extra condition".

Regards,
Chip Campbell

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to