The attached patch fixes the problem with folds getting out of sync in
a window if its buffer was edited in a window in another tab.
The same situation used to occur if a file was edited in a non-current tab,
it was changed from outside of Vim and reloaded.
Additionally, the function free_all_mem() did not free quickfix-related
data for any window outside the current tab.
--
Cheers,
Lech
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
diff -Nacr vim7_runtime_orig/doc/todo.txt vim7_runtime/doc/todo.txt
*** vim7_runtime_orig/doc/todo.txt 2009-03-22 20:39:46.000000000 +0100
--- vim7_runtime/doc/todo.txt 2009-04-11 19:57:42.000000000 +0200
***************
*** 53,60 ****
Cursorline highlighting combines with Search ('hlsearch') but not with
SpellBad. (Jim Karsten, 2009 Mar 18)
- Folds messed up in other tab page. (Vlad Irnov, 2009 Mar 17)
-
":he ctrl_u" can be auto-corrected to ":he ctrl-u".
Win32: patch for cross compile xxd and GvimExt. (Markus Heidelberg, 2009 Mar
--- 53,58 ----
diff --git a/src/fileio.c b/src/fileio.c
index eec68e8..4145c71 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6846,10 +6846,11 @@ buf_reload(buf, orig_mode)
#endif
#ifdef FEAT_FOLDING
{
- win_T *wp;
+ win_T *wp;
+ tabpage_T *tp;
/* Update folds unless they are defined manually. */
- FOR_ALL_WINDOWS(wp)
+ FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == curwin->w_buffer
&& !foldmethodIsManual(wp))
foldUpdateAll(wp);
diff --git a/src/mark.c b/src/mark.c
index 3dddad6..ab3a0e3 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -1023,6 +1023,7 @@ mark_adjust(line1, line2, amount, amount_after)
int fnum = curbuf->b_fnum;
linenr_T *lp;
win_T *win;
+ tabpage_T *tab;
if (line2 < line1 && amount_after == 0L) /* nothing to do */
return;
@@ -1064,7 +1065,7 @@ mark_adjust(line1, line2, amount, amount_after)
/* quickfix marks */
qf_mark_adjust(NULL, line1, line2, amount, amount_after);
/* location lists */
- FOR_ALL_WINDOWS(win)
+ FOR_ALL_TAB_WINDOWS(tab, win)
qf_mark_adjust(win, line1, line2, amount, amount_after);
#endif
@@ -1086,7 +1087,7 @@ mark_adjust(line1, line2, amount, amount_after)
/*
* Adjust items in all windows related to the current buffer.
*/
- FOR_ALL_WINDOWS(win)
+ FOR_ALL_TAB_WINDOWS(tab, win)
{
#ifdef FEAT_JUMPLIST
if (!cmdmod.lockmarks)
diff --git a/src/misc1.c b/src/misc1.c
index 3fdcdec..cfa2cd1 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2717,6 +2717,7 @@ changed_common(lnum, col, lnume, xtra)
long xtra;
{
win_T *wp;
+ tabpage_T *tp;
int i;
#ifdef FEAT_JUMPLIST
int cols;
@@ -2769,7 +2770,7 @@ changed_common(lnum, col, lnume, xtra)
curbuf->b_changelistlen = JUMPLISTSIZE - 1;
mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1,
sizeof(pos_T) * (JUMPLISTSIZE - 1));
- FOR_ALL_WINDOWS(wp)
+ FOR_ALL_TAB_WINDOWS(tp, wp)
{
/* Correct position in changelist for other windows on
* this buffer. */
@@ -2777,7 +2778,7 @@ changed_common(lnum, col, lnume, xtra)
--wp->w_changelistidx;
}
}
- FOR_ALL_WINDOWS(wp)
+ FOR_ALL_TAB_WINDOWS(tp, wp)
{
/* For other windows, if the position in the changelist is
* at the end it stays at the end. */
@@ -2796,7 +2797,7 @@ changed_common(lnum, col, lnume, xtra)
#endif
}
- FOR_ALL_WINDOWS(wp)
+ FOR_ALL_TAB_WINDOWS(tp, wp)
{
if (wp->w_buffer == curbuf)
{
diff --git a/src/misc2.c b/src/misc2.c
index cfc1bad..9fda8d5 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1075,11 +1075,12 @@ free_all_mem()
#ifdef FEAT_QUICKFIX
{
- win_T *win;
+ win_T *win;
+ tabpage_T *tab;
qf_free_all(NULL);
/* Free all location lists */
- FOR_ALL_WINDOWS(win)
+ FOR_ALL_TAB_WINDOWS(tab, win)
qf_free_all(win);
}
#endif