Hi Marius!

On Di, 20 Aug 2013, Marius Gedminas wrote:

> Vim 7.4 broke my svn filetype plugin (http://mg.pov.lt/vim/ftplugin/svn.vim).
> 
> The plugin opens a new split window and puts the output of 'svn diff' in
> there when I run 'svn commit'.  This window gets some attributes set,
> including 'previewwindow', which I use to make vim quit as soon as I
> close the svn-commit.tmp file.
> 
> With vim 7.4 the preview window appears empty (lacking even a status
> line), and you cannot switch to it with Ctrl-W W.
> 
> Steps to reproduce:
> 
>   echo "au BufRead,BufNewFile * new|put ='some text'|setlocal pvw" > bug.vim
>   vim -u bug.vim newfile.txt
> 
> Expected behavior (which I get with vim 7.3.547, and which I used to get
> with 7.3.verylargenumbers):
> 
>   http://i.imgur.com/MRN6f9c.png -- you get two windows, with some text
>   in the first one
> 
> Actual behavior:
> 
>   http://i.imgur.com/0KKz1i3.png -- the preview window takes up space,
>   but is completely blank, doesn't even have a statusline, and cannot be
>   switched to.
> 
> Note: if you run vim -u bug.vim, and then open a new file with :e, this
> bug doesn't show up.

I might have caused this with patch 7.3.1201. Strange, this error didn't 
happen with my plugin. Anyway, here is an alternative approach:

diff --git a/src/main.c b/src/main.c
--- a/src/main.c
+++ b/src/main.c
@@ -2816,6 +2816,8 @@
 # ifdef FEAT_AUTOCMD
     --autocmd_no_enter;
 # endif
+    /* make the first window the current window */
+    win_enter(firstwin, FALSE);
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
     /*
      * Avoid making a preview window the current window.
@@ -2827,13 +2829,11 @@
        for (win = firstwin; win != NULL; win = win->w_next)
            if (!win->w_p_pvw)
            {
-               firstwin = win;
+               win_goto(win);
                break;
            }
     }
 #endif
-    /* make the first window the current window */
-    win_enter(firstwin, FALSE);
 
 # ifdef FEAT_AUTOCMD
     --autocmd_no_leave;



Mit freundlichen Grüßen
Christian
-- 
Die Menschen wären alle bescheidener und demütiger, trieben sie alle
nur eine Kunst.
                -- Jean Paul

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui