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.3 / 7.3.748 < prev    next >
Encoding:
Internet Message Format  |  2012-12-04  |  14.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.748
  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.3.748
  11. Problem:    Cannot properly test conceal mode.
  12. Solution:   Add the screencol() and screenrow() functions.  Use them in
  13.         test88. (Simon Ruderich)
  14. Files:        runtime/doc/eval.txt, src/eval.c, src/proto/screen.pro,
  15.         src/screen.c, src/testdir/Make_amiga.mak,
  16.         src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
  17.         src/testdir/Make_os2.mak, src/testdir/Make_vms.mms
  18.         src/testdir/Makefile, src/testdir/test88.in,
  19.         src/testdir/test88.ok
  20.  
  21.  
  22. *** ../vim-7.3.747/runtime/doc/eval.txt    2012-11-14 18:10:49.000000000 +0100
  23. --- runtime/doc/eval.txt    2012-12-05 15:45:34.000000000 +0100
  24. ***************
  25. *** 1892,1897 ****
  26. --- 1903,1910 ----
  27.   resolve( {filename})        String    get filename a shortcut points to
  28.   reverse( {list})        List    reverse {list} in-place
  29.   round( {expr})            Float    round off {expr}
  30. + screencol()            Number    current cursor column
  31. + screenrow()            Number    current cursor row
  32.   search( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
  33.                   Number    search for {pattern}
  34.   searchdecl( {name} [, {global} [, {thisblock}]])
  35. ***************
  36. *** 4848,4862 ****
  37.               echo round(-4.5)
  38.   <            -5.0
  39.           {only available when compiled with the |+float| feature}
  40. !         
  41. !         
  42.   search({pattern} [, {flags} [, {stopline} [, {timeout}]]])    *search()*
  43.           Search for regexp pattern {pattern}.  The search starts at the
  44.           cursor position (you can use |cursor()| to set it).
  45.   
  46.           If there is no match a 0 is returned and the cursor doesn't
  47.           move.  No error message is given.
  48. -         When a match has been found its line number is returned.
  49.   
  50.           {flags} is a String, which can contain these character flags:
  51.           'b'    search backward instead of forward
  52. --- 4874,4907 ----
  53.               echo round(-4.5)
  54.   <            -5.0
  55.           {only available when compiled with the |+float| feature}
  56. ! screencol()                            *screencol()*
  57. !         The result is a Number, which is the current screen column of
  58. !         the cursor. The leftmost column has number 1.
  59. !         This function is mainly used for testing.
  60. !         Note: Always returns the current screen column, thus if used
  61. !         in a command (e.g. ":echo screencol()") it will return the
  62. !         column inside the command line, which is 1 when the command is
  63. !         executed. To get the cursor position in the file use one of
  64. !         the following mappings: >
  65. !             nnoremap <expr> GG ":echom ".screencol()."\n"
  66. !             nnoremap <silent> GG :echom screencol()<CR>
  67. ! <
  68. ! screenrow()                            *screenrow()*
  69. !         The result is a Number, which is the current screen row of the
  70. !         cursor.  The top line has number one.
  71. !         This function is mainly used for testing.
  72. !         Note: Same restrictions as with |screencol()|.
  73.   search({pattern} [, {flags} [, {stopline} [, {timeout}]]])    *search()*
  74.           Search for regexp pattern {pattern}.  The search starts at the
  75.           cursor position (you can use |cursor()| to set it).
  76.   
  77. +         When a match has been found its line number is returned.
  78.           If there is no match a 0 is returned and the cursor doesn't
  79.           move.  No error message is given.
  80.   
  81.           {flags} is a String, which can contain these character flags:
  82.           'b'    search backward instead of forward
  83. *** ../vim-7.3.747/src/eval.c    2012-12-05 15:16:42.000000000 +0100
  84. --- src/eval.c    2012-12-05 16:03:23.000000000 +0100
  85. ***************
  86. *** 668,673 ****
  87. --- 668,675 ----
  88.   #ifdef FEAT_FLOAT
  89.   static void f_round __ARGS((typval_T *argvars, typval_T *rettv));
  90.   #endif
  91. + static void f_screencol __ARGS((typval_T *argvars, typval_T *rettv));
  92. + static void f_screenrow __ARGS((typval_T *argvars, typval_T *rettv));
  93.   static void f_search __ARGS((typval_T *argvars, typval_T *rettv));
  94.   static void f_searchdecl __ARGS((typval_T *argvars, typval_T *rettv));
  95.   static void f_searchpair __ARGS((typval_T *argvars, typval_T *rettv));
  96. ***************
  97. *** 8033,8038 ****
  98. --- 8035,8042 ----
  99.   #ifdef FEAT_FLOAT
  100.       {"round",        1, 1, f_round},
  101.   #endif
  102. +     {"screencol",    0, 0, f_screencol},
  103. +     {"screenrow",    0, 0, f_screenrow},
  104.       {"search",        1, 4, f_search},
  105.       {"searchdecl",    1, 3, f_searchdecl},
  106.       {"searchpair",    3, 7, f_searchpair},
  107. ***************
  108. *** 15725,15730 ****
  109. --- 15729,15758 ----
  110.   #endif
  111.   
  112.   /*
  113. +  * "screencol()" function
  114. +  *
  115. +  * First column is 1 to be consistent with virtcol().
  116. +  */
  117. +     static void
  118. + f_screencol(argvars, rettv)
  119. +     typval_T    *argvars UNUSED;
  120. +     typval_T    *rettv;
  121. + {
  122. +     rettv->vval.v_number = screen_screencol() + 1;
  123. + }
  124. + /*
  125. +  * "screenrow()" function
  126. +  */
  127. +     static void
  128. + f_screenrow(argvars, rettv)
  129. +     typval_T    *argvars UNUSED;
  130. +     typval_T    *rettv;
  131. + {
  132. +     rettv->vval.v_number = screen_screenrow() + 1;
  133. + }
  134. + /*
  135.    * "search()" function
  136.    */
  137.       static void
  138. *** ../vim-7.3.747/src/proto/screen.pro    2012-11-20 16:56:49.000000000 +0100
  139. --- src/proto/screen.pro    2012-12-05 15:57:35.000000000 +0100
  140. ***************
  141. *** 50,53 ****
  142. --- 50,55 ----
  143.   int messaging __ARGS((void));
  144.   void showruler __ARGS((int always));
  145.   int number_width __ARGS((win_T *wp));
  146. + int screen_screencol __ARGS((void));
  147. + int screen_screenrow __ARGS((void));
  148.   /* vim: set ft=c : */
  149. *** ../vim-7.3.747/src/screen.c    2012-12-05 15:32:24.000000000 +0100
  150. --- src/screen.c    2012-12-05 15:58:02.000000000 +0100
  151. ***************
  152. *** 10264,10266 ****
  153. --- 10264,10286 ----
  154.       return n;
  155.   }
  156.   #endif
  157. + /*
  158. +  * Return the current cursor column. This is the actual position on the
  159. +  * screen. First column is 0.
  160. +  */
  161. +     int
  162. + screen_screencol()
  163. + {
  164. +     return screen_cur_col;
  165. + }
  166. + /*
  167. +  * Return the current cursor row. This is the actual position on the screen.
  168. +  * First row is 0.
  169. +  */
  170. +     int
  171. + screen_screenrow()
  172. + {
  173. +     return screen_cur_row;
  174. + }
  175. *** ../vim-7.3.747/src/testdir/Make_amiga.mak    2012-06-29 12:54:32.000000000 +0200
  176. --- src/testdir/Make_amiga.mak    2012-12-05 16:00:14.000000000 +0100
  177. ***************
  178. *** 31,37 ****
  179.           test66.out test67.out test68.out test69.out test70.out \
  180.           test71.out test72.out test73.out test74.out test75.out \
  181.           test76.out test77.out test78.out test79.out test80.out \
  182. !         test81.out test82.out test83.out test84.out
  183.   
  184.   .SUFFIXES: .in .out
  185.   
  186. --- 31,37 ----
  187.           test66.out test67.out test68.out test69.out test70.out \
  188.           test71.out test72.out test73.out test74.out test75.out \
  189.           test76.out test77.out test78.out test79.out test80.out \
  190. !         test81.out test82.out test83.out test84.out test88.out
  191.   
  192.   .SUFFIXES: .in .out
  193.   
  194. ***************
  195. *** 135,137 ****
  196. --- 135,138 ----
  197.   test82.out: test82.in
  198.   test83.out: test83.in
  199.   test84.out: test84.in
  200. + test88.out: test88.in
  201. *** ../vim-7.3.747/src/testdir/Make_dos.mak    2012-10-06 19:10:29.000000000 +0200
  202. --- src/testdir/Make_dos.mak    2012-12-05 16:00:29.000000000 +0100
  203. ***************
  204. *** 30,36 ****
  205.           test68.out test69.out test71.out test72.out test73.out \
  206.           test74.out test75.out test76.out test77.out test78.out \
  207.           test79.out test80.out test81.out test82.out test83.out \
  208. !         test84.out test85.out test86.out test87.out
  209.   
  210.   SCRIPTS32 =    test50.out test70.out
  211.   
  212. --- 30,36 ----
  213.           test68.out test69.out test71.out test72.out test73.out \
  214.           test74.out test75.out test76.out test77.out test78.out \
  215.           test79.out test80.out test81.out test82.out test83.out \
  216. !         test84.out test85.out test86.out test87.out test88.out
  217.   
  218.   SCRIPTS32 =    test50.out test70.out
  219.   
  220. *** ../vim-7.3.747/src/testdir/Make_ming.mak    2012-10-06 19:10:29.000000000 +0200
  221. --- src/testdir/Make_ming.mak    2012-12-05 16:00:40.000000000 +0100
  222. ***************
  223. *** 50,56 ****
  224.           test68.out test69.out test71.out test72.out test73.out \
  225.           test74.out test75.out test76.out test77.out test78.out \
  226.           test79.out test80.out test81.out test82.out test83.out \
  227. !         test84.out test85.out test86.out test87.out
  228.   
  229.   SCRIPTS32 =    test50.out test70.out
  230.   
  231. --- 50,56 ----
  232.           test68.out test69.out test71.out test72.out test73.out \
  233.           test74.out test75.out test76.out test77.out test78.out \
  234.           test79.out test80.out test81.out test82.out test83.out \
  235. !         test84.out test85.out test86.out test87.out test88.out
  236.   
  237.   SCRIPTS32 =    test50.out test70.out
  238.   
  239. *** ../vim-7.3.747/src/testdir/Make_os2.mak    2012-06-29 12:54:32.000000000 +0200
  240. --- src/testdir/Make_os2.mak    2012-12-05 16:00:50.000000000 +0100
  241. ***************
  242. *** 31,37 ****
  243.           test66.out test67.out test68.out test69.out test70.out \
  244.           test71.out test72.out test73.out test74.out test75.out \
  245.           test76.out test77.out test78.out test79.out test80.out \
  246. !         test81.out test82.out test83.out test84.out
  247.   
  248.   .SUFFIXES: .in .out
  249.   
  250. --- 31,37 ----
  251.           test66.out test67.out test68.out test69.out test70.out \
  252.           test71.out test72.out test73.out test74.out test75.out \
  253.           test76.out test77.out test78.out test79.out test80.out \
  254. !         test81.out test82.out test83.out test84.out test88.out
  255.   
  256.   .SUFFIXES: .in .out
  257.   
  258. *** ../vim-7.3.747/src/testdir/Make_vms.mms    2012-10-06 19:10:29.000000000 +0200
  259. --- src/testdir/Make_vms.mms    2012-12-05 16:01:03.000000000 +0100
  260. ***************
  261. *** 4,10 ****
  262.   # Authors:    Zoltan Arpadffy, <arpadffy@polarhome.com>
  263.   #        Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  264.   #
  265. ! # Last change:  2012 Oct 06
  266.   #
  267.   # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  268.   # Edit the lines in the Configuration section below to select.
  269. --- 4,10 ----
  270.   # Authors:    Zoltan Arpadffy, <arpadffy@polarhome.com>
  271.   #        Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
  272.   #
  273. ! # Last change:  2012 Dec 05
  274.   #
  275.   # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
  276.   # Edit the lines in the Configuration section below to select.
  277. ***************
  278. *** 76,82 ****
  279.        test66.out test67.out test68.out test69.out \
  280.        test71.out test72.out test74.out test75.out test76.out \
  281.        test77.out test78.out test79.out test80.out test81.out \
  282. !      test82.out test83.out test84.out
  283.   
  284.   # Known problems:
  285.   # Test 30: a problem around mac format - unknown reason
  286. --- 76,82 ----
  287.        test66.out test67.out test68.out test69.out \
  288.        test71.out test72.out test74.out test75.out test76.out \
  289.        test77.out test78.out test79.out test80.out test81.out \
  290. !      test82.out test83.out test84.out test88.out
  291.   
  292.   # Known problems:
  293.   # Test 30: a problem around mac format - unknown reason
  294. *** ../vim-7.3.747/src/testdir/Makefile    2012-10-06 19:10:29.000000000 +0200
  295. --- src/testdir/Makefile    2012-12-05 15:59:02.000000000 +0100
  296. ***************
  297. *** 13,19 ****
  298.   
  299.   SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
  300.           test7.out test8.out test9.out test10.out test11.out \
  301. !         test12.out  test13.out test14.out test15.out test17.out \
  302.           test18.out test19.out test20.out test21.out test22.out \
  303.           test23.out test24.out test25.out test26.out test27.out \
  304.           test28.out test29.out test30.out test31.out test32.out \
  305. --- 13,19 ----
  306.   
  307.   SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
  308.           test7.out test8.out test9.out test10.out test11.out \
  309. !         test12.out test13.out test14.out test15.out test17.out \
  310.           test18.out test19.out test20.out test21.out test22.out \
  311.           test23.out test24.out test25.out test26.out test27.out \
  312.           test28.out test29.out test30.out test31.out test32.out \
  313. ***************
  314. *** 27,33 ****
  315.           test69.out test70.out test71.out test72.out test73.out \
  316.           test74.out test75.out test76.out test77.out test78.out \
  317.           test79.out test80.out test81.out test82.out test83.out \
  318. !         test84.out test85.out test86.out test87.out
  319.   
  320.   SCRIPTS_GUI = test16.out
  321.   
  322. --- 27,33 ----
  323.           test69.out test70.out test71.out test72.out test73.out \
  324.           test74.out test75.out test76.out test77.out test78.out \
  325.           test79.out test80.out test81.out test82.out test83.out \
  326. !         test84.out test85.out test86.out test87.out test88.out
  327.   
  328.   SCRIPTS_GUI = test16.out
  329.   
  330. *** ../vim-7.3.747/src/testdir/test88.in    2012-12-05 16:08:56.000000000 +0100
  331. --- src/testdir/test88.in    2012-12-05 15:40:05.000000000 +0100
  332. ***************
  333. *** 0 ****
  334. --- 1,85 ----
  335. + vim: set ft=vim
  336. + Tests for correct display (cursor column position) with +conceal and
  337. + tabulators.
  338. + STARTTEST
  339. + :so small.vim
  340. + :if !has('conceal')
  341. +    e! test.ok
  342. +    wq! test.out
  343. + :endif
  344. + :" Conceal settings.
  345. + :set conceallevel=2
  346. + :set concealcursor=nc
  347. + :syntax match test /|/ conceal
  348. + :" Save current cursor position. Only works in <expr> mode, can't be used
  349. + :" with :normal because it moves the cursor to the command line. Thanks to ZyX
  350. + :" <zyx.vim@gmail.com> for the idea to use an <expr> mapping.
  351. + :let positions = []
  352. + :nnoremap <expr> GG ":let positions += ['".screenrow().":".screencol()."']\n"
  353. + :" Start test.
  354. + /^start:
  355. + :normal ztj
  356. + GGk
  357. + :" We should end up in the same column when running these commands on the two
  358. + :" lines.
  359. + :normal ft
  360. + GGk
  361. + :normal $
  362. + GGk
  363. + :normal 0j
  364. + GGk
  365. + :normal ft
  366. + GGk
  367. + :normal $
  368. + GGk
  369. + :normal 0j0j
  370. + GGk
  371. + :" Same for next test block.
  372. + :normal ft
  373. + GGk
  374. + :normal $
  375. + GGk
  376. + :normal 0j
  377. + GGk
  378. + :normal ft
  379. + GGk
  380. + :normal $
  381. + GGk
  382. + :normal 0j0j
  383. + GGk
  384. + :" And check W with multiple tabs and conceals in a line.
  385. + :normal W
  386. + GGk
  387. + :normal W
  388. + GGk
  389. + :normal W
  390. + GGk
  391. + :normal $
  392. + GGk
  393. + :normal 0j
  394. + GGk
  395. + :normal W
  396. + GGk
  397. + :normal W
  398. + GGk
  399. + :normal W
  400. + GGk
  401. + :normal $
  402. + GGk
  403. + :" Display result.
  404. + :call append('$', 'end:')
  405. + :call append('$', positions)
  406. + :/^end/,$wq! test.out
  407. + ENDTEST
  408. + start:
  409. + .concealed.     text
  410. + |concealed|    text
  411. +     .concealed.    text
  412. +     |concealed|    text
  413. + .a.    .b.    .c.    .d.
  414. + |a|    |b|    |c|    |d|
  415. *** ../vim-7.3.747/src/testdir/test88.ok    2012-12-05 16:08:56.000000000 +0100
  416. --- src/testdir/test88.ok    2012-12-05 15:40:05.000000000 +0100
  417. ***************
  418. *** 0 ****
  419. --- 1,23 ----
  420. + end:
  421. + 2:1
  422. + 2:17
  423. + 2:20
  424. + 3:1
  425. + 3:17
  426. + 3:20
  427. + 5:8
  428. + 5:25
  429. + 5:28
  430. + 6:8
  431. + 6:25
  432. + 6:28
  433. + 8:1
  434. + 8:9
  435. + 8:17
  436. + 8:25
  437. + 8:27
  438. + 9:1
  439. + 9:9
  440. + 9:17
  441. + 9:25
  442. + 9:26
  443. *** ../vim-7.3.747/src/version.c    2012-12-05 15:32:24.000000000 +0100
  444. --- src/version.c    2012-12-05 16:07:46.000000000 +0100
  445. ***************
  446. *** 727,728 ****
  447. --- 727,730 ----
  448.   {   /* Add new patch number below this line */
  449. + /**/
  450. +     748,
  451.   /**/
  452.  
  453. -- 
  454. hundred-and-one symptoms of being an internet addict:
  455. 101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.
  456.  
  457.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  458. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  459. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  460.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  461.