]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.301 v7.3.301
authorBram Moolenaar <Bram@vim.org>
Wed, 7 Sep 2011 17:58:09 +0000 (19:58 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 Sep 2011 17:58:09 +0000 (19:58 +0200)
Problem:    When 'smartindent' and 'copyindent' are set a Tab is used even
            though 'expandtab' is set.
Solution:   Do not insert Tabs. Add a test. (Christian Brabandt)

src/misc1.c
src/testdir/test19.in
src/testdir/test19.ok
src/version.c

index a3a20597be261a2d67add70b7020058dafdbecd6..589a145cc5d5ad5d189fcb1cfc6de28f870564ca 100644 (file)
@@ -363,7 +363,7 @@ copy_indent(size, src)
 
        /* Fill to next tabstop with a tab, if possible */
        tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
-       if (todo >= tab_pad)
+       if (todo >= tab_pad && !curbuf->b_p_et)
        {
            todo -= tab_pad;
            ++ind_len;
@@ -372,7 +372,7 @@ copy_indent(size, src)
        }
 
        /* Add tabs required for indent */
-       while (todo >= (int)curbuf->b_p_ts)
+       while (todo >= (int)curbuf->b_p_ts && !curbuf->b_p_et)
        {
            todo -= (int)curbuf->b_p_ts;
            ++ind_len;
index bdcfb77dba3b12aad1cd32f8e0ce45b944970e63..ff6e255174f33c8c60115c0b216fb0247b45f3fe 100644 (file)
@@ -12,6 +12,9 @@ r
 0wR                    \b\b\b\e
 :" Test replacing with Tabs
 0wR                    \e
+:" Test that copyindent works with expandtab set
+:set expandtab smartindent copyindent ts=8 sw=8 sts=8
+:exe "norm! o{\<cr>x"
 :?^start?,$w! test.out
 :qa!
 ENDTEST
index ba4eb63beb9fdc4adb3d360afa9a7764ff037b97..23d51507dbf8aed599417f74a95d5e4a0cf54e4d 100644 (file)
@@ -5,3 +5,5 @@ test text
     a cde
                hi
 test text
+{
+        x
index c3614035c489eae1a143905efa637515c8c31219..be9f058db254cba95db886c418485f5c04030c24 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    301,
 /**/
     300,
 /**/