/*
* return TRUE if 'c' is a keyword character: Letters and characters from
- * 'iskeyword' option for current buffer.
+ * 'iskeyword' option for the current buffer.
* For multi-byte characters mb_get_class() is used (builtin rules).
*/
int
addlen = (int)STRLEN(str);
- /*
- * Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
- */
if (offset == 0 && addlen <= typebuf.tb_off)
{
+ /*
+ * Easy case: there is room in front of typebuf.tb_buf[typebuf.tb_off]
+ */
typebuf.tb_off -= addlen;
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
}
-
- /*
- * Need to allocate a new buffer.
- * In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
- * characters. We add some extra room to avoid having to allocate too
- * often.
- */
else
{
+ /*
+ * Need to allocate a new buffer.
+ * In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
+ * characters. We add some extra room to avoid having to allocate too
+ * often.
+ */
newoff = MAXMAPLEN + 4;
newlen = typebuf.tb_len + addlen + newoff + 4 * (MAXMAPLEN + 4);
if (newlen < 0) /* string is getting too long */
{
/* KeyTyped = FALSE; When the command that stuffed something
* was typed, behave like the stuffed command was typed.
- * needed for CTRL-W CTRl-] to open a fold, for example. */
+ * needed for CTRL-W CTRL-] to open a fold, for example. */
KeyStuffed = TRUE;
}
if (typebuf.tb_no_abbr_cnt == 0)
}
/*
- * Write list of strings to file
+ * Write "list" of strings to file "fd".
*/
int
write_list(FILE *fd, list_T *list, int binary)
TO ADD A NEW STYLE TEST:
1) Create a test_<subject>.vim file.
-2) Add test_<subject>.vim to NEW_TESTS in Make_all.mak in alphabetical order.
-3) Use make test_<subject>.res to run a single test in src/testdir/.
+2) Add test_<subject>.res to NEW_TESTS in Make_all.mak in alphabetical order.
+3) Also add an entry in src/Makefile.
+4) Use make test_<subject>.res to run a single test in src/testdir/.
Use make test_<subject> to run a single test in src/.
-4) Also add an entry in src/Makefile.
What you can use (see test_assert.vim for an example):
- Call assert_equal(), assert_true(), assert_false(), etc.