2017-09-19 3:19 GMT+03:00 FocusedWolf <[email protected]>:
> I tested my .vimrc on Linux gVim and found no issue, but Windows gVim
> behaves strangely :)

With the nature of the issue it is highly unlikely that linux/Windows
makes any difference in this regard. What are versions in both cases?

>
> Steps to demonstrate the bug:
>
> 1. Create a .vimrc that consists only of the two functions listed at the
> bottom of this post.
>    One function is a workaround (i found that disabling the outtermost
> try-catch allowed the function to work as expected, but its still strange
> because if the outtermost catch is catching the exception then why isn't the
> catch block being executed.... Anyway like i said, this issue affects
> Windows gVim but not Linux gVim.
>
> 2. Open any text file.
>
> 3. Run the following commands:
>    :call TestBug
>    :call TestWorks
>
> Output which i received:
>
> gVim Windows output:
>
>     :call TestBug()
>
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match 0
>     match 1
>     match 1
>
>     :call TestWorks()
>
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match 0
>
> gVim Linux output:
>
>     :call TestBug()
>
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>
>     :call TestWorks()
>
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>     inner: Vim(lvimgrep):E480: No match: asdf1234
>     match: 0
>
> My .vimrc:
>
> function! TestBug()
>     let pattern = 'asdf1234'
>     let str = 'lvimgrep /' . pattern . '/g ' . fnameescape(bufname("%"))
>
>     try
>         let i = 0
>         while i < 3
>             let i = i+1
>
>             "NOTE: On Windows, this next try-catch only works when the
> outside try-catch is disabled,
>             "      but on Linux, this same code works.
>
>             let match = 1
>             try
>                 execute(str)
>             catch /.*/
>                 let match = 0
>                 echomsg 'inner: ' . v:exception
>             endtry
>
>             echomsg 'match: ' . match
>         endwhile
>     catch /.*/
>         echomsg 'outter: ' . v:exception
>     endtry
> endfunction
>
> function! TestWorks()
>     let pattern = 'asdf1234'
>     let str = 'lvimgrep /' . pattern . '/g ' . fnameescape(bufname("%"))
>
>     "NOTE: On Windows this try-catch has to be disabled for the inner
> try-catch to work,
>     "      but disabling this is not needed for this to work on Linux.
>
>     "try
>         let i = 0
>         while i < 3
>             let i = i+1
>
>             let match = 1
>             try
>                 execute(str)
>             catch /.*/
>                 let match = 0
>                 echomsg 'inner: ' . v:exception
>             endtry
>
>             echomsg 'match: ' . match
>         endwhile
>     "catch /.*/
>     "    echomsg 'outter: ' . v:exception
>     "endtry
> endfunction
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
>
> --
> --
> You received this message from the "vim_dev" 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_dev" 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.

-- 
-- 
You received this message from the "vim_dev" 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_dev" 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.

Raspunde prin e-mail lui