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 / old / 5.4.12 < prev    next >
Encoding:
Internet Message Format  |  1999-08-02  |  4.2 KB

  1. To: =?iso-8859-2?Q?Hanu=B9_Adler?= <had@articon.cz>
  2. Cc: vim-dev@vim.org
  3. Subject: patch 5.4.12 (was: bug in vim)
  4. In-Reply-To: <19990802095423.A6296@dwarf.articon.cz>
  5. Fcc: outbox
  6. From: Bram Moolenaar <Bram@moolenaar.net>
  7. ------------
  8.  
  9. Hanus Adler wrote:
  10.  
  11. > it seems that the smartindent feature does not work properly in vim 5.4.
  12. > It did work in 5.3. Now when I have both smartindent on and autoindent
  13. > on, vim does not insert TABs as described in the manual on a new line
  14. > when the previous line ends in {. Also, it does not insert the TABs when
  15. > I am on a line ending in } and open a new line with O. Only when I
  16. > insert TABs manually or when the { is preceded by TAB, it seems to work,
  17. > but rather illogically. I found out about it when I tried to write some
  18. > perl script, but then I tested it on a non-perl file and it was the
  19. > same.
  20. > I have checked that
  21. >     +smartindent is compiled in vim
  22. >     smartindent is on
  23. >     autoindent is on or off
  24. >     cindent is off
  25.  
  26. I can reproduce it, but only when the current line has zero indent.  After
  27. some debugging, discovered that there is a misplace 'else'.  This is because
  28. the code to set "trunc_line" was moved upwards.  Thus now the 'else' was
  29. paired with the wrong 'if'.  Let's make a patch for this.
  30.  
  31. Patch 5.4.12
  32. Problem:    When using 'smartindent', there would be no extra indent if the
  33.             current line did not have any indent already. (Hanus Adler)
  34. Solution:   There was a wrongly placed "else", that previously matched with
  35.             the "if" that set trunc_line.  Removed the "else" and added a
  36.             check for trunc_line to be false.
  37. Files:      src/misc1.c
  38.  
  39.  
  40. *** ../vim-5.4/src/misc1.c    Sun Jul 25 22:02:07 1999
  41. --- src/misc1.c    Tue Aug  3 13:15:04 1999
  42. ***************
  43. *** 290,297 ****
  44.        * don't add an indent. Fixes inserting a NL before '{' in line
  45.        *    "if (condition) {"
  46.        */
  47. !     else if (curbuf->b_p_si && *saved_line != NUL &&
  48. !                        (p_extra == NULL || first_char != '{'))
  49.       {
  50.           char_u  *ptr;
  51.           char_u  last_char;
  52. --- 290,297 ----
  53.        * don't add an indent. Fixes inserting a NL before '{' in line
  54.        *    "if (condition) {"
  55.        */
  56. !     if (!trunc_line && curbuf->b_p_si && *saved_line != NUL
  57. !                     && (p_extra == NULL || first_char != '{'))
  58.       {
  59.           char_u  *ptr;
  60.           char_u  last_char;
  61. *** ../vim-5.4/src/version.h    Sat Jul 31 16:29:33 1999
  62. --- src/version.h    Tue Aug  3 13:19:47 1999
  63. ***************
  64. *** 19,26 ****
  65.   #define VIM_VERSION_MINOR_STR        "4"
  66.   #define VIM_VERSION_BUILD         57
  67.   #define VIM_VERSION_BUILD_STR        "57"
  68. ! #define VIM_VERSION_PATCHLEVEL         11
  69. ! #define VIM_VERSION_PATCHLEVEL_STR    "11"
  70.   
  71.   /*
  72.    * VIM_VERSION_NODOT is used for the runtime directory name.
  73. --- 19,26 ----
  74.   #define VIM_VERSION_MINOR_STR        "4"
  75.   #define VIM_VERSION_BUILD         57
  76.   #define VIM_VERSION_BUILD_STR        "57"
  77. ! #define VIM_VERSION_PATCHLEVEL         12
  78. ! #define VIM_VERSION_PATCHLEVEL_STR    "12"
  79.   
  80.   /*
  81.    * VIM_VERSION_NODOT is used for the runtime directory name.
  82. ***************
  83. *** 30,35 ****
  84.    */
  85.   #define VIM_VERSION_NODOT    "vim54"
  86.   #define VIM_VERSION_SHORT    "5.4"
  87. ! #define VIM_VERSION_MEDIUM    "5.4.11"
  88. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.11 (1999 Jul 31)"
  89. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.11 (1999 Jul 31, compiled "
  90. --- 30,35 ----
  91.    */
  92.   #define VIM_VERSION_NODOT    "vim54"
  93.   #define VIM_VERSION_SHORT    "5.4"
  94. ! #define VIM_VERSION_MEDIUM    "5.4.12"
  95. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.12 (1999 Aug 3)"
  96. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.12 (1999 Aug 3, compiled "
  97.  
  98. --
  99. BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
  100. ANOTHER MONK:    And St.  Attila raised his hand grenade up on high saying "O
  101.                  Lord bless this thy hand grenade that with it thou mayest
  102.                  blow thine enemies to tiny bits, in thy mercy. "and the Lord
  103.                  did grin and people did feast upon the lambs and sloths and
  104.                  carp and anchovies and orang-utans and breakfast cereals and
  105.                  fruit bats and...
  106. BROTHER MAYNARD: Skip a bit brother ...
  107.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  108.  
  109. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  110.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  111.