summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-02-28 23:50:17 +0000
committerBram Moolenaar <Bram@vim.org>2006-02-28 23:50:17 +0000
commitb388adb1887c50d351cff7d15227e837303a64cb (patch)
tree9552cf02286f6d4ab79f0e9065257667bef1697a
parent5e3cb7e8699f855193179a8cb799d1087f4a2ac9 (diff)
downloadvim-b388adb1887c50d351cff7d15227e837303a64cb.zip
updated for version 7.0210
-rw-r--r--runtime/doc/index.txt3
-rw-r--r--src/normal.c1
-rw-r--r--src/spell.c89
3 files changed, 77 insertions, 16 deletions
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 2bc8af3ba..47477c1b9 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 7.0aa. Last change: 2006 Feb 24
+*index.txt* For Vim version 7.0aa. Last change: 2006 Feb 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1476,6 +1476,7 @@ The commands are sorted on the non-optional part of their name.
|:tselect| :ts[elect] list matching tags and select one
|:tunmenu| :tu[nmenu] remove menu tooltip
|:undo| :u[ndo] undo last change(s)
+|:undojoin| :undoj[oin] join next change with previous undo block
|:unabbreviate| :una[bbreviate] remove abbreviation
|:unhide| :unh[ide] open a window for each loaded file in the
buffer list
diff --git a/src/normal.c b/src/normal.c
index b603184be..16ab0c1a2 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -670,6 +670,7 @@ normal_cmd(oap, toplevel)
c = 'd';
else
c = 'c';
+ msg_nowait = TRUE; /* don't delay going to insert mode */
}
#endif
diff --git a/src/spell.c b/src/spell.c
index ab9bf3109..12a8a09e7 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -813,6 +813,10 @@ static char_u *spell_enc __ARGS((void));
static void int_wordlist_spl __ARGS((char_u *fname));
static void spell_load_cb __ARGS((char_u *fname, void *cookie));
static slang_T *spell_load_file __ARGS((char_u *fname, char_u *lang, slang_T *old_lp, int silent));
+static int get2c __ARGS((FILE *fd));
+static int get3c __ARGS((FILE *fd));
+static int get4c __ARGS((FILE *fd));
+static time_t get8c __ARGS((FILE *fd));
static char_u *read_cnt_string __ARGS((FILE *fd, int cnt_bytes, int *lenp));
static char_u *read_string __ARGS((FILE *fd, int cnt));
static int read_region_section __ARGS((FILE *fd, slang_T *slang, int len));
@@ -2602,8 +2606,7 @@ spell_load_file(fname, lang, old_lp, silent)
if (n == SN_END)
break;
c = getc(fd); /* <sectionflags> */
- len = (getc(fd) << 24) + (getc(fd) << 16) + (getc(fd) << 8) + getc(fd);
- /* <sectionlen> */
+ len = get4c(fd); /* <sectionlen> */
if (len < 0)
goto truncerr;
@@ -2657,8 +2660,7 @@ spell_load_file(fname, lang, old_lp, silent)
break;
case SN_SUGFILE:
- for (i = 7; i >= 0; --i) /* <timestamp> */
- lp->sl_sugtime += getc(fd) << (i * 8);
+ lp->sl_sugtime = get8c(fd); /* <timestamp> */
break;
case SN_COMPOUND:
@@ -2749,6 +2751,66 @@ endOK:
}
/*
+ * Read 2 bytes from "fd" and turn them into an int, MSB first.
+ */
+ static int
+get2c(fd)
+ FILE *fd;
+{
+ long n;
+
+ n = getc(fd);
+ n = (n << 8) + getc(fd);
+ return n;
+}
+
+/*
+ * Read 3 bytes from "fd" and turn them into an int, MSB first.
+ */
+ static int
+get3c(fd)
+ FILE *fd;
+{
+ long n;
+
+ n = getc(fd);
+ n = (n << 8) + getc(fd);
+ n = (n << 8) + getc(fd);
+ return n;
+}
+
+/*
+ * Read 4 bytes from "fd" and turn them into an int, MSB first.
+ */
+ static int
+get4c(fd)
+ FILE *fd;
+{
+ long n;
+
+ n = getc(fd);
+ n = (n << 8) + getc(fd);
+ n = (n << 8) + getc(fd);
+ n = (n << 8) + getc(fd);
+ return n;
+}
+
+/*
+ * Read 8 bytes from "fd" and turn them into a time_t, MSB first.
+ */
+ static time_t
+get8c(fd)
+ FILE *fd;
+{
+ time_t n = 0;
+ int i;
+
+ for (i = 0; i < 8; ++i)
+ n = (n << 8) + getc(fd);
+ return n;
+}
+
+/*
* Read a length field from "fd" in "cnt_bytes" bytes.
* Allocate memory, read the string into it and add a NUL at the end.
* Returns NULL when the count is zero.
@@ -2882,7 +2944,7 @@ read_prefcond_section(fd, lp)
char_u buf[MAXWLEN + 1];
/* <prefcondcnt> <prefcond> ... */
- cnt = (getc(fd) << 8) + getc(fd); /* <prefcondcnt> */
+ cnt = get2c(fd); /* <prefcondcnt> */
if (cnt <= 0)
return SP_FORMERROR;
@@ -2928,7 +2990,7 @@ read_rep_section(fd, gap, first)
fromto_T *ftp;
int i;
- cnt = (getc(fd) << 8) + getc(fd); /* <repcount> */
+ cnt = get2c(fd); /* <repcount> */
if (cnt < 0)
return SP_TRUNCERROR;
@@ -2993,7 +3055,7 @@ read_sal_section(fd, slang)
if (i & SAL_REM_ACCENTS)
slang->sl_rem_accents = TRUE;
- cnt = (getc(fd) << 8) + getc(fd); /* <salcount> */
+ cnt = get2c(fd); /* <salcount> */
if (cnt < 0)
return SP_TRUNCERROR;
@@ -3746,7 +3808,7 @@ spell_read_tree(fd, bytsp, idxsp, prefixtree, prefixcnt)
/* The tree size was computed when writing the file, so that we can
* allocate it as one long block. <nodecount> */
- len = (getc(fd) << 24) + (getc(fd) << 16) + (getc(fd) << 8) + getc(fd);
+ len = get4c(fd);
if (len < 0)
return SP_TRUNCERROR;
if (len > 0)
@@ -3836,7 +3898,7 @@ read_tree_node(fd, byts, idxs, maxidx, startidx, prefixtree, maxprefcondnr)
c |= getc(fd); /* <affixID> */
- n = (getc(fd) << 8) + getc(fd); /* <prefcondnr> */
+ n = get2c(fd); /* <prefcondnr> */
if (n >= maxprefcondnr)
return SP_FORMERROR;
c |= (n << 8);
@@ -3862,7 +3924,7 @@ read_tree_node(fd, byts, idxs, maxidx, startidx, prefixtree, maxprefcondnr)
else /* c == BY_INDEX */
{
/* <nodeidx> */
- n = (getc(fd) << 16) + (getc(fd) << 8) + getc(fd);
+ n = get3c(fd);
if (n < 0 || n >= maxidx)
return SP_FORMERROR;
idxs[idx] = n + SHARED_MASK;
@@ -10185,9 +10247,7 @@ suggest_load_files()
/* Check the timestamp, it must be exactly the same as the one in
* the .spl file. Otherwise the word numbers won't match. */
- timestamp = 0;
- for (i = 7; i >= 0; --i) /* <timestamp> */
- timestamp += getc(fd) << (i * 8);
+ timestamp = get8c(fd); /* <timestamp> */
if (timestamp != slang->sl_sugtime)
{
EMSG2(_("E781: .sug file doesn't match .spl file: %s"),
@@ -10220,8 +10280,7 @@ someerror:
if (slang->sl_sugbuf == NULL)
goto someerror;
/* <sugwcount> */
- wcount = (getc(fd) << 24) + (getc(fd) << 16) + (getc(fd) << 8)
- + getc(fd);
+ wcount = get4c(fd);
if (wcount < 0)
goto someerror;