To:
[email protected]
Subject: Patch 6.1a.010
Fcc: outbox
From: Bram Moolenaar <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------
Patch 6.1a.010
Problem: When using ":help" and opening a new window, the alternate file
isn't set.
Solution: Set the alternate file to the previously edited file.
Files: src/ex_cmds.c
*** ../vim61a.009/src/ex_cmds.c Mon Feb 18 14:13:22 2002
--- src/ex_cmds.c Wed Feb 27 20:21:31 2002
***************
*** 4377,4382 ****
--- 4377,4383 ----
int need_free = FALSE;
char_u *p;
int empty_fnum = 0;
+ int alt_fnum = 0;
buf_T *buf;
if (eap != NULL)
***************
*** 4476,4486 ****
#endif
/*
! * open help file (do_ecmd() will set b_help flag, readfile() will
! * set b_p_ro flag)
*/
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
ECMD_HIDE + ECMD_SET_HELP);
empty_fnum = curbuf->b_fnum;
}
}
--- 4477,4490 ----
#endif
/*
! * Open help file (do_ecmd() will set b_help flag, readfile() will
! * set b_p_ro flag).
! * Set the alternate file to the previously edited file.
*/
+ alt_fnum = curbuf->b_fnum;
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
ECMD_HIDE + ECMD_SET_HELP);
+ curwin->w_alt_fnum = alt_fnum;
empty_fnum = curbuf->b_fnum;
}
}
***************
*** 4502,4507 ****
--- 4506,4515 ----
if (buf != NULL)
wipe_buffer(buf);
}
+
+ /* keep the previous alternate file */
+ if (alt_fnum != 0 && curwin->w_alt_fnum == empty_fnum)
+ curwin->w_alt_fnum = alt_fnum;
/*
* Always set these options after jumping to a help tag, because the user
*** ../vim61a.009/src/version.c Wed Feb 27 17:28:07 2002
--- src/version.c Wed Feb 27 20:24:18 2002
***************
*** 608,609 ****
--- 608,611 ----
{ /* Add new patch number below this line */
+ /**/
+ 10,
/**/
--
hundred-and-one symptoms of being an internet addict:
64. The remote to the T.V. is missing...and you don't even care.
/// Bram Moolenaar --
[email protected] --
http://www.moolenaar.net \\\
/// Creator of Vim --
http://vim.sf.net --
ftp://ftp.vim.org/pub/vim \\\
\\\ Project leader for A-A-P --
http://www.a-a-p.org ///
\\\ Help me helping AIDS orphans in Uganda -
http://iccf-holland.org ///