To: vim_dev@googlegroups.com Subject: Patch 8.2.0250 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0250 Problem: test_clear_search_pat() is unused. Solution: Remove the function. (Yegappan Lakshmanan, closes #5624) Files: runtime/doc/eval.txt, runtime/doc/testing.txt, runtime/doc/usr_41.txt, src/evalfunc.c, src/proto/regexp.pro, src/proto/search.pro, src/proto/testing.pro, src/regexp.c, src/search.c, src/testdir/test_writefile.vim, src/testing.c *** ../vim-8.2.0249/runtime/doc/eval.txt 2020-02-08 16:39:45.427835657 +0100 --- runtime/doc/eval.txt 2020-02-12 22:11:21.501271122 +0100 *************** *** 2846,2852 **** test_alloc_fail({id}, {countdown}, {repeat}) none make memory allocation fail test_autochdir() none enable 'autochdir' during startup - test_clear_search_pat() none clears the last used search pattern test_feedinput({string}) none add key sequence to input buffer test_garbagecollect_now() none free memory right now for testing test_garbagecollect_soon() none free memory soon for testing --- 2848,2853 ---- *** ../vim-8.2.0249/runtime/doc/testing.txt 2020-02-08 16:39:45.423835674 +0100 --- runtime/doc/testing.txt 2020-02-12 22:11:21.501271122 +0100 *************** *** 52,62 **** startup has finished. - test_clear_search_pat() *test_clear_search_pat()* - Clears the last used search pattern (|/|) and the substitute - pattern (|:s|). This is useful for testing conditions where - these patterns are not set previously. - test_feedinput({string}) *test_feedinput()* Characters in {string} are queued for processing as if they were typed by the user. This uses a low level input buffer. --- 52,57 ---- *** ../vim-8.2.0249/runtime/doc/usr_41.txt 2020-02-05 20:38:15.927599576 +0100 --- runtime/doc/usr_41.txt 2020-02-12 22:11:21.505271101 +0100 *************** *** 963,969 **** assert_report() report a test failure test_alloc_fail() make memory allocation fail test_autochdir() enable 'autochdir' during startup - test_clear_search_pat() clears the last used search pattern test_override() test with Vim internal overrides test_garbagecollect_now() free memory right now test_getvalue() get value of an internal variable --- 963,968 ---- *** ../vim-8.2.0249/src/evalfunc.c 2020-02-08 16:39:45.423835674 +0100 --- src/evalfunc.c 2020-02-12 22:11:21.505271101 +0100 *************** *** 811,817 **** #endif {"test_alloc_fail", 3, 3, FEARG_1, &t_void, f_test_alloc_fail}, {"test_autochdir", 0, 0, 0, &t_void, f_test_autochdir}, - {"test_clear_search_pat", 0, 0, 0, &t_void, f_test_clear_search_pat}, {"test_feedinput", 1, 1, FEARG_1, &t_void, f_test_feedinput}, {"test_garbagecollect_now", 0, 0, 0, &t_void, f_test_garbagecollect_now}, {"test_garbagecollect_soon", 0, 0, 0, &t_void, f_test_garbagecollect_soon}, --- 811,816 ---- *** ../vim-8.2.0249/src/proto/regexp.pro 2020-02-05 20:38:15.931599558 +0100 --- src/proto/regexp.pro 2020-02-12 22:11:21.505271101 +0100 *************** *** 12,18 **** regprog_T *vim_regcomp(char_u *expr_arg, int re_flags); void vim_regfree(regprog_T *prog); void free_regexp_stuff(void); - void free_regexp_prev_sub(void); int regprog_in_use(regprog_T *prog); int vim_regexec_prog(regprog_T **prog, int ignore_case, char_u *line, colnr_T col); int vim_regexec(regmatch_T *rmp, char_u *line, colnr_T col); --- 12,17 ---- *** ../vim-8.2.0249/src/proto/search.pro 2020-02-05 20:38:15.931599558 +0100 --- src/proto/search.pro 2020-02-12 22:11:21.505271101 +0100 *************** *** 9,15 **** void save_last_search_pattern(void); void restore_last_search_pattern(void); char_u *last_search_pattern(void); - void free_last_pat(int idx); int ignorecase(char_u *pat); int ignorecase_opt(char_u *pat, int ic_in, int scs); int pat_has_uppercase(char_u *pat); --- 9,14 ---- *** ../vim-8.2.0249/src/proto/testing.pro 2020-02-05 20:38:15.931599558 +0100 --- src/proto/testing.pro 2020-02-12 22:11:21.505271101 +0100 *************** *** 13,19 **** void f_assert_true(typval_T *argvars, typval_T *rettv); void f_test_alloc_fail(typval_T *argvars, typval_T *rettv); void f_test_autochdir(typval_T *argvars, typval_T *rettv); - void f_test_clear_search_pat(typval_T *argvars, typval_T *rettv); void f_test_feedinput(typval_T *argvars, typval_T *rettv); void f_test_getvalue(typval_T *argvars, typval_T *rettv); void f_test_option_not_set(typval_T *argvars, typval_T *rettv); --- 13,18 ---- *** ../vim-8.2.0249/src/regexp.c 2020-02-05 20:38:15.931599558 +0100 --- src/regexp.c 2020-02-12 22:11:21.505271101 +0100 *************** *** 2663,2677 **** } #endif - /* - * Free the previously used substitute search pattern. - */ - void - free_regexp_prev_sub(void) - { - VIM_CLEAR(reg_prev_sub); - } - #ifdef FEAT_EVAL static void report_re_switch(char_u *pat) --- 2663,2668 ---- *** ../vim-8.2.0249/src/search.c 2020-02-05 20:38:15.931599558 +0100 --- src/search.c 2020-02-12 22:11:21.505271101 +0100 *************** *** 380,391 **** } #endif - void - free_last_pat(int idx) - { - VIM_CLEAR(spats[idx].pat); - } - /* * Return TRUE when case should be ignored for search pattern "pat". * Uses the 'ignorecase' and 'smartcase' options. --- 380,385 ---- *** ../vim-8.2.0249/src/testdir/test_writefile.vim 2020-02-02 15:32:09.967762406 +0100 --- src/testdir/test_writefile.vim 2020-02-12 22:11:26.045249967 +0100 *************** *** 214,219 **** --- 214,223 ---- call assert_fails('1,2write', 'E140:') close! + call assert_fails('w > Xtest', 'E494:') + + call assert_fails('w > Xtest', 'E494:') + " Try to overwrite a directory if has('unix') call mkdir('Xdir1') *** ../vim-8.2.0249/src/testing.c 2020-02-05 20:38:15.931599558 +0100 --- src/testing.c 2020-02-12 22:11:26.045249967 +0100 *************** *** 632,650 **** } /* - * "test_clear_search_pat()" - * Free the last search and substitute patterns - */ - void - f_test_clear_search_pat(typval_T *argvars UNUSED, typval_T *rettv UNUSED) - { - free_last_pat(RE_SUBST); - free_last_pat(RE_SEARCH); - set_old_sub(NULL); - free_regexp_prev_sub(); - } - - /* * "test_feedinput()" */ void --- 632,637 ---- *** ../vim-8.2.0249/src/version.c 2020-02-12 21:52:29.271749459 +0100 --- src/version.c 2020-02-12 22:12:38.212916332 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 250, /**/ -- hundred-and-one symptoms of being an internet addict: 65. The last time you looked at the clock it was 11:30pm, and in what seems like only a few seconds later, your sister runs past you to catch her 7am school bus. /// 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 ///