Bram,
I had a problem with the NrrwRgn Plugin that seems to hang vim.
Debugging it, I could make vim hang with this input:
vim -N -c 'try|noa sview $VIMRUNTIME/doc/options.txt|finally |bw|endtry
(It seems my .vimrc interferes, not sure which setting does).
This hangs in buffer.c
,----
| * If the deleted buffer is the current one, close the current window
| * (unless it's the only window). Repeat this so long as we end up in
| * a window with this buffer (but try at most 10 times).
| */
| while (buf == curbuf
| # ifdef FEAT_AUTOCMD
| && !(curwin->w_closing || curwin->w_buffer->b_closing)
| # endif
| && (firstwin != lastwin || first_tabpage->tp_next != NULL))
| win_close(curwin, FALSE);
`----
And keeps on trying to close the window and doesn't succeed. So here is
a patch, that tries at most 10 times.
diff -r 40f4f573218c src/buffer.c
--- a/src/buffer.c Sat Aug 10 12:45:09 2013 +0200
+++ b/src/buffer.c Sat Aug 10 15:41:19 2013 +0200
@@ -1017,6 +1017,7 @@
buf_T *bp;
int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
|| action == DOBUF_WIPE);
+ int i = 0;
switch (start)
{
@@ -1179,14 +1180,17 @@
/*
* If the deleted buffer is the current one, close the current window
* (unless it's the only window). Repeat this so long as we end up in
- * a window with this buffer.
+ * a window with this buffer (but try at most 10 times).
*/
- while (buf == curbuf
+ while (buf == curbuf && i < 10
# ifdef FEAT_AUTOCMD
&& !(curwin->w_closing || curwin->w_buffer->b_closing)
# endif
&& (firstwin != lastwin || first_tabpage->tp_next != NULL))
+ {
win_close(curwin, FALSE);
+ i++;
+ }
#endif
regards,
Christian
--
Fritzchen zu seiner Mutter: "Versteh ich nicht, warum heißen die
Kerzen "Wachskerzen", wenn sie doch immer kleiner werden!"
--
--
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/groups/opt_out.