home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.079 < prev    next >
Encoding:
Internet Message Format  |  2013-11-07  |  13.3 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.079
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.079
  11. Problem:    A script cannot detect whether 'hlsearch' highlighting is actually
  12.             displayed.
  13. Solution:   Add the "v:hlsearch" variable. (ZyX)
  14. Files:      src/runtime/doc/eval.txt, src/eval.c, src/ex_docmd.c,
  15.             src/option.c, src/screen.c, src/search.c, src/tag.c, src/vim.h,
  16.             src/testdir/test101.in, src/testdir/test101.ok,
  17.             src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
  18.             src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
  19.             src/testdir/Make_vms.mms, src/testdir/Makefile
  20.  
  21.  
  22. diff: ../vim-7.4.078/src/runtime/doc/eval.txt: No such file or directory
  23. diff: src/runtime/doc/eval.txt: No such file or directory
  24. *** ../vim-7.4.078/src/eval.c    2013-11-05 07:12:59.000000000 +0100
  25. --- src/eval.c    2013-11-08 04:11:46.000000000 +0100
  26. ***************
  27. *** 356,361 ****
  28. --- 356,362 ----
  29.       {VV_NAME("mouse_col",     VAR_NUMBER), 0},
  30.       {VV_NAME("operator",     VAR_STRING), VV_RO},
  31.       {VV_NAME("searchforward",     VAR_NUMBER), 0},
  32. +     {VV_NAME("hlsearch",     VAR_NUMBER), 0},
  33.       {VV_NAME("oldfiles",     VAR_LIST), 0},
  34.       {VV_NAME("windowid",     VAR_NUMBER), VV_RO},
  35.   };
  36. ***************
  37. *** 871,876 ****
  38. --- 872,878 ----
  39.           hash_add(&compat_hashtab, p->vv_di.di_key);
  40.       }
  41.       set_vim_var_nr(VV_SEARCHFORWARD, 1L);
  42. +     set_vim_var_nr(VV_HLSEARCH, 1L);
  43.       set_reg_var(0);  /* default for v:register is not 0 but '"' */
  44.   
  45.   #ifdef EBCDIC
  46. ***************
  47. *** 20613,20618 ****
  48. --- 20615,20627 ----
  49.           v->di_tv.vval.v_number = get_tv_number(tv);
  50.           if (STRCMP(varname, "searchforward") == 0)
  51.               set_search_direction(v->di_tv.vval.v_number ? '/' : '?');
  52. + #ifdef FEAT_SEARCH_EXTRA
  53. +         else if (STRCMP(varname, "hlsearch") == 0)
  54. +         {
  55. +             no_hlsearch = !v->di_tv.vval.v_number;
  56. +             redraw_all_later(SOME_VALID);
  57. +         }
  58. + #endif
  59.           }
  60.           return;
  61.       }
  62. *** ../vim-7.4.078/src/ex_docmd.c    2013-07-24 15:09:37.000000000 +0200
  63. --- src/ex_docmd.c    2013-11-08 04:17:01.000000000 +0100
  64. ***************
  65. *** 11389,11395 ****
  66.   ex_nohlsearch(eap)
  67.       exarg_T    *eap UNUSED;
  68.   {
  69. !     no_hlsearch = TRUE;
  70.       redraw_all_later(SOME_VALID);
  71.   }
  72.   
  73. --- 11389,11395 ----
  74.   ex_nohlsearch(eap)
  75.       exarg_T    *eap UNUSED;
  76.   {
  77. !     SET_NO_HLSEARCH(TRUE);
  78.       redraw_all_later(SOME_VALID);
  79.   }
  80.   
  81. *** ../vim-7.4.078/src/option.c    2013-11-06 05:26:08.000000000 +0100
  82. --- src/option.c    2013-11-08 04:17:32.000000000 +0100
  83. ***************
  84. *** 7811,7817 ****
  85.       /* when 'hlsearch' is set or reset: reset no_hlsearch */
  86.       else if ((int *)varp == &p_hls)
  87.       {
  88. !     no_hlsearch = FALSE;
  89.       }
  90.   #endif
  91.   
  92. --- 7811,7817 ----
  93.       /* when 'hlsearch' is set or reset: reset no_hlsearch */
  94.       else if ((int *)varp == &p_hls)
  95.       {
  96. !     SET_NO_HLSEARCH(FALSE);
  97.       }
  98.   #endif
  99.   
  100. *** ../vim-7.4.078/src/screen.c    2013-07-13 12:23:00.000000000 +0200
  101. --- src/screen.c    2013-11-08 04:17:48.000000000 +0100
  102. ***************
  103. *** 7447,7453 ****
  104.           {
  105.           /* don't free regprog in the match list, it's a copy */
  106.           vim_regfree(shl->rm.regprog);
  107. !         no_hlsearch = TRUE;
  108.           }
  109.           shl->rm.regprog = NULL;
  110.           shl->lnum = 0;
  111. --- 7447,7453 ----
  112.           {
  113.           /* don't free regprog in the match list, it's a copy */
  114.           vim_regfree(shl->rm.regprog);
  115. !         SET_NO_HLSEARCH(TRUE);
  116.           }
  117.           shl->rm.regprog = NULL;
  118.           shl->lnum = 0;
  119. *** ../vim-7.4.078/src/search.c    2013-11-07 04:46:43.000000000 +0100
  120. --- src/search.c    2013-11-08 04:18:57.000000000 +0100
  121. ***************
  122. *** 289,295 ****
  123.       /* If 'hlsearch' set and search pat changed: need redraw. */
  124.       if (p_hls)
  125.           redraw_all_later(SOME_VALID);
  126. !     no_hlsearch = FALSE;
  127.   #endif
  128.       }
  129.   }
  130. --- 289,295 ----
  131.       /* If 'hlsearch' set and search pat changed: need redraw. */
  132.       if (p_hls)
  133.           redraw_all_later(SOME_VALID);
  134. !     SET_NO_HLSEARCH(FALSE);
  135.   #endif
  136.       }
  137.   }
  138. ***************
  139. *** 333,339 ****
  140.       spats[1] = saved_spats[1];
  141.       last_idx = saved_last_idx;
  142.   # ifdef FEAT_SEARCH_EXTRA
  143. !     no_hlsearch = saved_no_hlsearch;
  144.   # endif
  145.       }
  146.   }
  147. --- 333,339 ----
  148.       spats[1] = saved_spats[1];
  149.       last_idx = saved_last_idx;
  150.   # ifdef FEAT_SEARCH_EXTRA
  151. !     SET_NO_HLSEARCH(saved_no_hlsearch);
  152.   # endif
  153.       }
  154.   }
  155. ***************
  156. *** 1148,1154 ****
  157.       if (no_hlsearch && !(options & SEARCH_KEEP))
  158.       {
  159.       redraw_all_later(SOME_VALID);
  160. !     no_hlsearch = FALSE;
  161.       }
  162.   #endif
  163.   
  164. --- 1148,1154 ----
  165.       if (no_hlsearch && !(options & SEARCH_KEEP))
  166.       {
  167.       redraw_all_later(SOME_VALID);
  168. !     SET_NO_HLSEARCH(FALSE);
  169.       }
  170.   #endif
  171.   
  172. ***************
  173. *** 5561,5567 ****
  174.           spats[idx].off.off = off;
  175.   #ifdef FEAT_SEARCH_EXTRA
  176.           if (setlast)
  177. !             no_hlsearch = !hlsearch_on;
  178.   #endif
  179.           }
  180.       }
  181. --- 5561,5569 ----
  182.           spats[idx].off.off = off;
  183.   #ifdef FEAT_SEARCH_EXTRA
  184.           if (setlast)
  185. !         {
  186. !             SET_NO_HLSEARCH(!hlsearch_on);
  187. !         }
  188.   #endif
  189.           }
  190.       }
  191. *** ../vim-7.4.078/src/tag.c    2013-09-05 12:06:26.000000000 +0200
  192. --- src/tag.c    2013-11-08 04:19:14.000000000 +0100
  193. ***************
  194. *** 3330,3336 ****
  195.   #ifdef FEAT_SEARCH_EXTRA
  196.       /* restore no_hlsearch when keeping the old search pattern */
  197.       if (search_options)
  198. !         no_hlsearch = save_no_hlsearch;
  199.   #endif
  200.   
  201.       /* Return OK if jumped to another file (at least we found the file!). */
  202. --- 3330,3338 ----
  203.   #ifdef FEAT_SEARCH_EXTRA
  204.       /* restore no_hlsearch when keeping the old search pattern */
  205.       if (search_options)
  206. !     {
  207. !         SET_NO_HLSEARCH(save_no_hlsearch);
  208. !     }
  209.   #endif
  210.   
  211.       /* Return OK if jumped to another file (at least we found the file!). */
  212. *** ../vim-7.4.078/src/vim.h    2013-08-02 16:02:27.000000000 +0200
  213. --- src/vim.h    2013-11-08 04:16:57.000000000 +0100
  214. ***************
  215. *** 1864,1872 ****
  216.   #define VV_MOUSE_COL    51
  217.   #define VV_OP        52
  218.   #define VV_SEARCHFORWARD 53
  219. ! #define VV_OLDFILES    54
  220. ! #define VV_WINDOWID    55
  221. ! #define VV_LEN        56    /* number of v: vars */
  222.   
  223.   #ifdef FEAT_CLIPBOARD
  224.   
  225. --- 1864,1873 ----
  226.   #define VV_MOUSE_COL    51
  227.   #define VV_OP        52
  228.   #define VV_SEARCHFORWARD 53
  229. ! #define VV_HLSEARCH    54
  230. ! #define VV_OLDFILES    55
  231. ! #define VV_WINDOWID    56
  232. ! #define VV_LEN        57    /* number of v: vars */
  233.   
  234.   #ifdef FEAT_CLIPBOARD
  235.   
  236. ***************
  237. *** 2246,2249 ****
  238. --- 2247,2256 ----
  239.   /* Character used as separated in autoload function/variable names. */
  240.   #define AUTOLOAD_CHAR '#'
  241.   
  242. + #ifdef FEAT_EVAL
  243. + # define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch)
  244. + #else
  245. + # define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
  246. + #endif
  247.   #endif /* VIM__H */
  248. *** ../vim-7.4.078/src/testdir/test101.in    2013-11-08 04:28:49.000000000 +0100
  249. --- src/testdir/test101.in    2013-11-08 04:11:46.000000000 +0100
  250. ***************
  251. *** 0 ****
  252. --- 1,45 ----
  253. + Test for v:hlsearch     vim: set ft=vim :
  254. + STARTTEST
  255. + :" Last abc: Q
  256. + :so small.vim
  257. + :new
  258. + :call setline(1, repeat(['aaa'], 10))
  259. + :set hlsearch nolazyredraw
  260. + :let r=[]
  261. + :command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch])
  262. + /aaa
  263. + :AddR
  264. + :nohlsearch
  265. + :AddR
  266. + :let v:hlsearch=1
  267. + :AddR
  268. + :let v:hlsearch=0
  269. + :AddR
  270. + :set hlsearch
  271. + :AddR
  272. + :let v:hlsearch=0
  273. + :AddR
  274. + n:AddR
  275. + :let v:hlsearch=0
  276. + :AddR
  277. + /
  278. + :AddR
  279. + :let r1=r[0][0]
  280. + :" I guess it is not guaranteed that screenattr outputs always the same character
  281. + :call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
  282. + :try
  283. + :   let v:hlsearch=[]
  284. + :catch
  285. + :   call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
  286. + :endtry
  287. + :bwipeout!
  288. + :$put=r
  289. + :call garbagecollect(1)
  290. + :"
  291. + :/^start:/,$wq! test.out
  292. + :" vim: et ts=4 isk-=\:
  293. + :call getchar()
  294. + ENDTEST
  295. + start:
  296. *** ../vim-7.4.078/src/testdir/test101.ok    2013-11-08 04:28:49.000000000 +0100
  297. --- src/testdir/test101.ok    2013-11-08 04:11:46.000000000 +0100
  298. ***************
  299. *** 0 ****
  300. --- 1,11 ----
  301. + start:
  302. + 1:highlighted
  303. + 0:not highlighted
  304. + 1:highlighted
  305. + 0:not highlighted
  306. + 1:highlighted
  307. + 0:not highlighted
  308. + 1:highlighted
  309. + 0:not highlighted
  310. + 1:highlighted
  311. + Vim(let):E706:
  312. *** ../vim-7.4.078/src/testdir/Make_amiga.mak    2013-11-07 03:25:51.000000000 +0100
  313. --- src/testdir/Make_amiga.mak    2013-11-08 04:22:13.000000000 +0100
  314. ***************
  315. *** 34,40 ****
  316.           test81.out test82.out test83.out test84.out test88.out \
  317.           test89.out test90.out test91.out test92.out test93.out \
  318.           test94.out test95.out test96.out test97.out test98.out \
  319. !         test99.out test100.out
  320.   
  321.   .SUFFIXES: .in .out
  322.   
  323. --- 34,40 ----
  324.           test81.out test82.out test83.out test84.out test88.out \
  325.           test89.out test90.out test91.out test92.out test93.out \
  326.           test94.out test95.out test96.out test97.out test98.out \
  327. !         test99.out test100.out test101.out
  328.   
  329.   .SUFFIXES: .in .out
  330.   
  331. ***************
  332. *** 151,153 ****
  333. --- 151,154 ----
  334.   test98.out: test98.in
  335.   test99.out: test99.in
  336.   test100.out: test100.in
  337. + test101.out: test101.in
  338. *** ../vim-7.4.078/src/testdir/Make_dos.mak    2013-11-07 03:25:51.000000000 +0100
  339. --- src/testdir/Make_dos.mak    2013-11-08 04:22:17.000000000 +0100
  340. ***************
  341. *** 33,39 ****
  342.           test84.out test85.out test86.out test87.out test88.out \
  343.           test89.out test90.out test91.out test92.out test93.out \
  344.           test94.out test95.out test96.out test98.out test99.out \
  345. !         test100.out
  346.   
  347.   SCRIPTS32 =    test50.out test70.out
  348.   
  349. --- 33,39 ----
  350.           test84.out test85.out test86.out test87.out test88.out \
  351.           test89.out test90.out test91.out test92.out test93.out \
  352.           test94.out test95.out test96.out test98.out test99.out \
  353. !         test100.out test101.out
  354.   
  355.   SCRIPTS32 =    test50.out test70.out
  356.   
  357. *** ../vim-7.4.078/src/testdir/Make_ming.mak    2013-11-07 03:25:51.000000000 +0100
  358. --- src/testdir/Make_ming.mak    2013-11-08 04:22:19.000000000 +0100
  359. ***************
  360. *** 53,59 ****
  361.           test84.out test85.out test86.out test87.out test88.out \
  362.           test89.out test90.out test91.out test92.out test93.out \
  363.           test94.out test95.out test96.out test98.out test99.out \
  364. !         test100out
  365.   
  366.   SCRIPTS32 =    test50.out test70.out
  367.   
  368. --- 53,59 ----
  369.           test84.out test85.out test86.out test87.out test88.out \
  370.           test89.out test90.out test91.out test92.out test93.out \
  371.           test94.out test95.out test96.out test98.out test99.out \
  372. !         test100out test101.out
  373.   
  374.   SCRIPTS32 =    test50.out test70.out
  375.   
  376. *** ../vim-7.4.078/src/testdir/Make_os2.mak    2013-11-07 03:25:51.000000000 +0100
  377. --- src/testdir/Make_os2.mak    2013-11-08 04:22:21.000000000 +0100
  378. ***************
  379. *** 35,41 ****
  380.           test81.out test82.out test83.out test84.out test88.out \
  381.           test89.out test90.out test91.out test92.out test93.out \
  382.           test94.out test95.out test96.out test98.out test99.out \
  383. !         test100.out
  384.   
  385.   .SUFFIXES: .in .out
  386.   
  387. --- 35,41 ----
  388.           test81.out test82.out test83.out test84.out test88.out \
  389.           test89.out test90.out test91.out test92.out test93.out \
  390.           test94.out test95.out test96.out test98.out test99.out \
  391. !         test100.out test101.out
  392.   
  393.   .SUFFIXES: .in .out
  394.   
  395. *** ../vim-7.4.078/src/testdir/Make_vms.mms    2013-11-07 03:25:51.000000000 +0100
  396. --- src/testdir/Make_vms.mms    2013-11-08 04:22:23.000000000 +0100
  397. ***************
  398. *** 4,10 ****
  399.   # Authors:    Zoltan Arpadffy, <arpadffy@polarhome.com>
  400.   #        Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  401.   #
  402. ! # Last change:  2013 Nov 07
  403.   #
  404.   # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  405.   # Edit the lines in the Configuration section below to select.
  406. --- 4,10 ----
  407.   # Authors:    Zoltan Arpadffy, <arpadffy@polarhome.com>
  408.   #        Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  409.   #
  410. ! # Last change:  2013 Nov 08
  411.   #
  412.   # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  413.   # Edit the lines in the Configuration section below to select.
  414. ***************
  415. *** 79,85 ****
  416.        test82.out test83.out test84.out test88.out test89.out \
  417.        test90.out test91.out test92.out test93.out test94.out \
  418.        test95.out test96.out test97.out test98.out test99.out \
  419. !      test100.out
  420.   
  421.   # Known problems:
  422.   # Test 30: a problem around mac format - unknown reason
  423. --- 79,85 ----
  424.        test82.out test83.out test84.out test88.out test89.out \
  425.        test90.out test91.out test92.out test93.out test94.out \
  426.        test95.out test96.out test97.out test98.out test99.out \
  427. !      test100.out test101.out
  428.   
  429.   # Known problems:
  430.   # Test 30: a problem around mac format - unknown reason
  431. *** ../vim-7.4.078/src/testdir/Makefile    2013-11-07 03:25:51.000000000 +0100
  432. --- src/testdir/Makefile    2013-11-08 04:22:26.000000000 +0100
  433. ***************
  434. *** 30,36 ****
  435.           test84.out test85.out test86.out test87.out test88.out \
  436.           test89.out test90.out test91.out test92.out test93.out \
  437.           test94.out test95.out test96.out test97.out test98.out \
  438. !         test99.out test100.out
  439.   
  440.   SCRIPTS_GUI = test16.out
  441.   
  442. --- 30,36 ----
  443.           test84.out test85.out test86.out test87.out test88.out \
  444.           test89.out test90.out test91.out test92.out test93.out \
  445.           test94.out test95.out test96.out test97.out test98.out \
  446. !         test99.out test100.out test101.out
  447.   
  448.   SCRIPTS_GUI = test16.out
  449.   
  450. *** ../vim-7.4.078/src/version.c    2013-11-08 03:15:39.000000000 +0100
  451. --- src/version.c    2013-11-08 04:11:08.000000000 +0100
  452. ***************
  453. *** 740,741 ****
  454. --- 740,743 ----
  455.   {   /* Add new patch number below this line */
  456. + /**/
  457. +     79,
  458.   /**/
  459.  
  460. -- 
  461. Corn oil comes from corn and olive oil comes from olives, so where
  462. does baby oil come from?
  463.  
  464.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  465. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  466. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  467.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  468.