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.750 < prev    next >
Encoding:
Internet Message Format  |  2012-12-04  |  3.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.750
  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.750
  11. Problem:    The justify macro does not always work correctly.
  12. Solution:   Fix off-by-one error (James McCoy)
  13. Files:        runtime/macros/justify.vim
  14.  
  15.  
  16. *** ../vim-7.3.749/runtime/macros/justify.vim    2010-08-15 21:57:19.000000000 +0200
  17. --- runtime/macros/justify.vim    2012-12-05 16:58:40.000000000 +0100
  18. ***************
  19. *** 1,4 ****
  20. ! " Function to left and rigt align text.
  21.   "
  22.   " Written by:    Preben "Peppe" Guldberg <c928400@student.dtu.dk>
  23.   " Created:    980806 14:13 (or around that time anyway)
  24. --- 1,4 ----
  25. ! " Function to left and right align text.
  26.   "
  27.   " Written by:    Preben "Peppe" Guldberg <c928400@student.dtu.dk>
  28.   " Created:    980806 14:13 (or around that time anyway)
  29. ***************
  30. *** 256,273 ****
  31.       let str = substitute(str, '\s\+$', '', '')
  32.       let str = substitute(str, '^\s\+', '', '')
  33.       let str = substitute(str, '\s\+', ' ', 'g')
  34. !     " Use substitute() hack to get strlen in characters instead of bytes
  35. !     let str_n = strlen(substitute(str, '.', 'x', 'g'))
  36.   
  37.       " Possible addition of space after punctuation
  38.       if exists("join_str")
  39.           let str = substitute(str, join_str, '\1 ', 'g')
  40.       endif
  41. !     let join_n = strlen(substitute(str, '.', 'x', 'g')) - str_n
  42.   
  43.       " Can extraspaces be added?
  44.       " Note that str_n may be less than strlen(str) [joinspaces above]
  45. !     if strlen(substitute(str, '.', 'x', 'g')) < tw - indent_n && str_n > 0
  46.           " How many spaces should be added
  47.           let s_add = tw - str_n - indent_n - join_n
  48.           let s_nr  = strlen(substitute(str, '\S', '', 'g') ) - join_n
  49. --- 256,272 ----
  50.       let str = substitute(str, '\s\+$', '', '')
  51.       let str = substitute(str, '^\s\+', '', '')
  52.       let str = substitute(str, '\s\+', ' ', 'g')
  53. !     let str_n = strdisplaywidth(str)
  54.   
  55.       " Possible addition of space after punctuation
  56.       if exists("join_str")
  57.           let str = substitute(str, join_str, '\1 ', 'g')
  58.       endif
  59. !     let join_n = strdisplaywidth(str) - str_n
  60.   
  61.       " Can extraspaces be added?
  62.       " Note that str_n may be less than strlen(str) [joinspaces above]
  63. !     if strdisplaywidth(str) <= tw - indent_n && str_n > 0
  64.           " How many spaces should be added
  65.           let s_add = tw - str_n - indent_n - join_n
  66.           let s_nr  = strlen(substitute(str, '\S', '', 'g') ) - join_n
  67. *** ../vim-7.3.749/src/version.c    2012-12-05 16:30:03.000000000 +0100
  68. --- src/version.c    2012-12-05 17:01:02.000000000 +0100
  69. ***************
  70. *** 727,728 ****
  71. --- 727,730 ----
  72.   {   /* Add new patch number below this line */
  73. + /**/
  74. +     750,
  75.   /**/
  76.  
  77. -- 
  78. To be rich is not the end, but only a change of worries.
  79.  
  80.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  81. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  82. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  83.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  84.