summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-01-14 21:23:38 +0000
committerBram Moolenaar <Bram@vim.org>2006-01-14 21:23:38 +0000
commitc32840f2674d4c6b06cfac8ec32791b5451bf31c (patch)
treea94f91721c326e599a2a5199762ebed4dbfe2a6e /src
parent04dbce064ed4282854348bd4fb5a806a6136bd04 (diff)
downloadvim-git-c32840f2674d4c6b06cfac8ec32791b5451bf31c.tar.gz
updated for version 7.0181v7.0181
Diffstat (limited to 'src')
-rw-r--r--src/eval.c11
-rw-r--r--src/memfile.c17
-rw-r--r--src/memline.c6
3 files changed, 34 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 482359331..c18b42d0f 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -17667,7 +17667,18 @@ trans_function_name(pp, skip, flags, fdp)
}
if (lv.ll_exp_name != NULL)
+ {
len = STRLEN(lv.ll_exp_name);
+ if (lead <= 2 && lv.ll_name == lv.ll_exp_name
+ && STRNCMP(lv.ll_name, "s:", 2) == 0)
+ {
+ /* When there was "s:" already or the name expanded to get a
+ * leading "s:" then remove it. */
+ lv.ll_name += 2;
+ len -= 2;
+ lead = 2;
+ }
+ }
else
{
if (lead == 2) /* skip over "s:" */
diff --git a/src/memfile.c b/src/memfile.c
index e1a6b603b..bac84fed9 100644
--- a/src/memfile.c
+++ b/src/memfile.c
@@ -701,6 +701,23 @@ mf_sync(mfp, flags)
}
/*
+ * For all blocks in memory file *mfp that have a positive block number set
+ * the dirty flag. These are blocks that need to be written to a newly
+ * created swapfile.
+ */
+ void
+mf_set_dirty(mfp)
+ memfile_T *mfp;
+{
+ bhdr_T *hp;
+
+ for (hp = mfp->mf_used_last; hp != NULL; hp = hp->bh_prev)
+ if (hp->bh_bnum > 0)
+ hp->bh_flags |= BH_DIRTY;
+ mfp->mf_dirty = TRUE;
+}
+
+/*
* insert block *hp in front of hashlist of memfile *mfp
*/
static void
diff --git a/src/memline.c b/src/memline.c
index 9abf15523..c87a955ad 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -563,7 +563,13 @@ ml_open_file(buf)
/* Flush block zero, so others can read it */
if (mf_sync(mfp, MFS_ZERO) == OK)
+ {
+ /* Mark all blocks that should be in the swapfile as dirty.
+ * Needed for when the 'swapfile' option was reset, so that
+ * the swap file was deleted, and then on again. */
+ mf_set_dirty(mfp);
break;
+ }
/* Writing block 0 failed: close the file and try another dir */
mf_close_file(buf, FALSE);
}