0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.0-192

This commit is contained in:
Bram Moolenaar 2007-02-07 02:41:57 +00:00
parent 48b66fb5a7
commit 47b8b15b5f
4 changed files with 18 additions and 8 deletions

View File

@ -555,6 +555,10 @@ EXTERN buf_T *firstbuf INIT(= NULL); /* first buffer */
EXTERN buf_T *lastbuf INIT(= NULL); /* last buffer */ EXTERN buf_T *lastbuf INIT(= NULL); /* last buffer */
EXTERN buf_T *curbuf INIT(= NULL); /* currently active buffer */ EXTERN buf_T *curbuf INIT(= NULL); /* currently active buffer */
/* Flag that is set when switching off 'swapfile'. It means that all blocks
* are to be loaded into memory. Shouldn't be global... */
EXTERN int mf_dont_release INIT(= FALSE); /* don't release blocks */
/* /*
* List of files being edited (global argument list). curwin->w_alist points * List of files being edited (global argument list). curwin->w_alist points
* to this when the window is using the global argument list. * to this when the window is using the global argument list.

View File

@ -76,7 +76,6 @@ extern int dos2; /* this is in os_amiga.c */
#define MEMFILE_PAGE_SIZE 4096 /* default page size */ #define MEMFILE_PAGE_SIZE 4096 /* default page size */
static long_u total_mem_used = 0; /* total memory used for memfiles */ static long_u total_mem_used = 0; /* total memory used for memfiles */
static int dont_release = FALSE; /* don't release blocks */
static void mf_ins_hash __ARGS((memfile_T *, bhdr_T *)); static void mf_ins_hash __ARGS((memfile_T *, bhdr_T *));
static void mf_rem_hash __ARGS((memfile_T *, bhdr_T *)); static void mf_rem_hash __ARGS((memfile_T *, bhdr_T *));
@ -279,10 +278,10 @@ mf_close_file(buf, getlines)
if (getlines) if (getlines)
{ {
/* get all blocks in memory by accessing all lines (clumsy!) */ /* get all blocks in memory by accessing all lines (clumsy!) */
dont_release = TRUE; mf_dont_release = TRUE;
for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum) for (lnum = 1; lnum <= buf->b_ml.ml_line_count; ++lnum)
(void)ml_get_buf(buf, lnum, FALSE); (void)ml_get_buf(buf, lnum, FALSE);
dont_release = FALSE; mf_dont_release = FALSE;
/* TODO: should check if all blocks are really in core */ /* TODO: should check if all blocks are really in core */
} }
@ -830,7 +829,7 @@ mf_release(mfp, page_count)
buf_T *buf; buf_T *buf;
/* don't release while in mf_close_file() */ /* don't release while in mf_close_file() */
if (dont_release) if (mf_dont_release)
return NULL; return NULL;
/* /*

View File

@ -2074,8 +2074,10 @@ errorret:
/* /*
* See if it is the same line as requested last time. * See if it is the same line as requested last time.
* Otherwise may need to flush last used line. * Otherwise may need to flush last used line.
* Don't use the last used line when 'swapfile' is reset, need to load all
* blocks.
*/ */
if (buf->b_ml.ml_line_lnum != lnum) if (buf->b_ml.ml_line_lnum != lnum || mf_dont_release)
{ {
ml_flush_line(buf); ml_flush_line(buf);
@ -3200,13 +3202,16 @@ ml_find_line(buf, lnum, action)
* If not, flush and release the locked block. * If not, flush and release the locked block.
* Don't do this for ML_INSERT_SAME, because the stack need to be updated. * Don't do this for ML_INSERT_SAME, because the stack need to be updated.
* Don't do this for ML_FLUSH, because we want to flush the locked block. * Don't do this for ML_FLUSH, because we want to flush the locked block.
* Don't do this when 'swapfile' is reset, we want to load all the blocks.
*/ */
if (buf->b_ml.ml_locked) if (buf->b_ml.ml_locked)
{ {
if (ML_SIMPLE(action) && buf->b_ml.ml_locked_low <= lnum if (ML_SIMPLE(action)
&& buf->b_ml.ml_locked_high >= lnum) && buf->b_ml.ml_locked_low <= lnum
&& buf->b_ml.ml_locked_high >= lnum
&& !mf_dont_release)
{ {
/* remember to update pointer blocks and stack later */ /* remember to update pointer blocks and stack later */
if (action == ML_INSERT) if (action == ML_INSERT)
{ {
++(buf->b_ml.ml_locked_lineadd); ++(buf->b_ml.ml_locked_lineadd);

View File

@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
192,
/**/ /**/
191, 191,
/**/ /**/