To: vim_dev@googlegroups.com Subject: Patch 7.4.1897 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1897 Problem: Various typos, long lines and style mistakes. Solution: Fix the typos, wrap lines, improve style. Files: src/buffer.c, src/ex_docmd.c, src/getchar.c, src/option.c, src/main.aap, src/testdir/README.txt, src/testdir/test_reltime.vim, src/testdir/test_tagjump.vim, src/INSTALL, src/config.aap.in, src/if_mzsch.c *** ../vim-7.4.1896/src/buffer.c 2016-05-29 16:24:45.953320300 +0200 --- src/buffer.c 2016-06-03 18:40:13.879265989 +0200 *************** *** 2516,2522 **** nr = curwin->w_alt_fnum; for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (buf->b_fnum == nr) ! return (buf); return NULL; } --- 2516,2522 ---- nr = curwin->w_alt_fnum; for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (buf->b_fnum == nr) ! return buf; return NULL; } *** ../vim-7.4.1896/src/ex_docmd.c 2016-04-02 19:39:11.781258089 +0200 --- src/ex_docmd.c 2016-04-14 18:19:49.784513988 +0200 *************** *** 2139,2145 **** #endif } ea.cmd = skipwhite(ea.cmd); ! lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) --- 2139,2146 ---- #endif } ea.cmd = skipwhite(ea.cmd); ! lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ! ea.addr_count == 0); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) *** ../vim-7.4.1896/src/getchar.c 2016-06-04 13:32:31.042331459 +0200 --- src/getchar.c 2016-06-04 14:22:57.682289825 +0200 *************** *** 79,85 **** static int KeyNoremap = 0; /* remapping flags */ /* ! * variables used by vgetorpeek() and flush_buffers() * * typebuf.tb_buf[] contains all characters that are not consumed yet. * typebuf.tb_buf[typebuf.tb_off] is the first valid character. --- 79,85 ---- static int KeyNoremap = 0; /* remapping flags */ /* ! * Variables used by vgetorpeek() and flush_buffers(). * * typebuf.tb_buf[] contains all characters that are not consumed yet. * typebuf.tb_buf[typebuf.tb_off] is the first valid character. *** ../vim-7.4.1896/src/option.c 2016-04-29 22:58:25.622876633 +0200 --- src/option.c 2016-05-24 10:12:30.211570051 +0200 *************** *** 1665,1671 **** {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_kp, PV_KP, { ! #if defined(MSWIN) (char_u *)":help", #else # ifdef VMS --- 1665,1671 ---- {"keywordprg", "kp", P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_kp, PV_KP, { ! #ifdef MSWIN (char_u *)":help", #else # ifdef VMS *** ../vim-7.4.1896/src/main.aap 2013-05-06 04:06:04.000000000 +0200 --- src/main.aap 2016-02-27 18:04:31.417984956 +0100 *************** *** 347,353 **** $PYTHON_SRC $TCL_SRC $RUBY_SRC - $SNIFF_SRC $WORKSHOP_SRC Objects = --- 347,352 ---- *** ../vim-7.4.1896/src/testdir/README.txt 2016-02-10 22:23:02.256605792 +0100 --- src/testdir/README.txt 2016-02-13 18:53:26.386746911 +0100 *************** *** 5,11 **** The numbered tests are older, we have switched to named tests. ! And then you can chose between a new style test, which is a Vim script, or an old style test, which uses Normal mode commands. Use a new style test if you can. --- 5,11 ---- The numbered tests are older, we have switched to named tests. ! And then you can choose between a new style test, which is a Vim script, or an old style test, which uses Normal mode commands. Use a new style test if you can. *************** *** 21,33 **** What you can use (see test_assert.vim for an example): - Call assert_equal(), assert_true() and assert_false(). - Use try/catch to check for exceptions. ! - Use alloc_fail() to have memory allocation fail. This makes it possible to to check memory allocation failures are handled gracefully. You need to change the source code to add an ID to the allocation. Update LAST_ID_USED above alloc_id() to the highest ID used. - Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for a while. E.g. to trigger the CursorMovedI autocommand event. See test_cursor_func.vim for an example TO ADD AN OLD STYLE TEST: --- 21,34 ---- What you can use (see test_assert.vim for an example): - Call assert_equal(), assert_true() and assert_false(). - Use try/catch to check for exceptions. ! - Use alloc_fail() to have memory allocation fail. This makes it possible to check memory allocation failures are handled gracefully. You need to change the source code to add an ID to the allocation. Update LAST_ID_USED above alloc_id() to the highest ID used. - Use disable_char_avail_for_testing(1) if char_avail() must return FALSE for a while. E.g. to trigger the CursorMovedI autocommand event. See test_cursor_func.vim for an example + - See the start of runtest.vim for more help. TO ADD AN OLD STYLE TEST: *** ../vim-7.4.1896/src/testdir/test_reltime.vim 2016-02-07 21:19:24.141042332 +0100 --- src/testdir/test_reltime.vim 2016-03-03 13:05:57.571394940 +0100 *************** *** 23,27 **** call assert_true(reltimestr(differs) != '0.0') call assert_true(reltimefloat(differs) < 0.1) call assert_true(reltimefloat(differs) > 0.0) - endfunc --- 23,26 ---- *** ../vim-7.4.1896/src/testdir/test_tagjump.vim 2016-04-18 19:45:13.463066926 +0200 --- src/testdir/test_tagjump.vim 2016-04-18 19:45:08.507117993 +0200 *************** *** 6,9 **** --- 6,10 ---- call assert_fails('ptag does_not_exist_tag_name', 'E426') set tagstack&vim endfunc + " vim: sw=2 et *** ../vim-7.4.1896/src/INSTALL 2015-12-31 19:06:56.064081736 +0100 --- src/INSTALL 2016-04-12 22:44:00.794223123 +0200 *************** *** 11,17 **** See INSTALLami.txt for Amiga See INSTALLmac.txt for Macintosh ! See INSTALLpc.txt for PC (MS-DOS, Windows 95/98/NT/XP) See INSTALLvms.txt for VMS See INSTALLx.txt for cross-compiling on Unix See ../README_390.txt for OS/390 Unix --- 11,17 ---- See INSTALLami.txt for Amiga See INSTALLmac.txt for Macintosh ! See INSTALLpc.txt for PC (Windows 95/98/NT/XP/Vista/7/8/10) See INSTALLvms.txt for VMS See INSTALLx.txt for cross-compiling on Unix See ../README_390.txt for OS/390 Unix *** ../vim-7.4.1896/src/config.aap.in 2016-01-24 20:36:18.870082307 +0100 --- src/config.aap.in 2016-02-27 18:03:48.934430847 +0100 *************** *** 75,83 **** RUBY_CFLAGS = @RUBY_CFLAGS@ RUBY_LIBS = @RUBY_LIBS@ - SNIFF_SRC = @SNIFF_SRC@ - SNIFF_OBJ = @SNIFF_OBJ@ - AWK = @AWK@ STRIP = @STRIP@ --- 75,80 ---- *** ../vim-7.4.1896/src/if_mzsch.c 2016-06-02 11:57:33.856786831 +0200 --- src/if_mzsch.c 2016-06-04 19:42:12.958026329 +0200 *************** *** 2725,2731 **** * Adjust marks. Invalidate any which lie in the * changed range, and move any in the remainder of the buffer. */ ! mark_adjust((linenr_T)lo, (linenr_T)(hi - 1), (long)MAXLNUM, (long)extra); changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra); if (buf->buf == curwin->w_buffer) --- 2725,2732 ---- * Adjust marks. Invalidate any which lie in the * changed range, and move any in the remainder of the buffer. */ ! mark_adjust((linenr_T)lo, (linenr_T)(hi - 1), ! (long)MAXLNUM, (long)extra); changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra); if (buf->buf == curwin->w_buffer) *** ../vim-7.4.1896/src/version.c 2016-06-04 20:14:00.302000092 +0200 --- src/version.c 2016-06-04 20:22:13.185993312 +0200 *************** *** 755,756 **** --- 755,758 ---- { /* Add new patch number below this line */ + /**/ + 1897, /**/ -- hundred-and-one symptoms of being an internet addict: 45. You buy a Captain Kirk chair with a built-in keyboard and mouse. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///