1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When 'smartindent' and 'copyindent' are set a Tab is used even
12 though 'expandtab' is set.
13 Solution: Do not insert Tabs. Add a test. (Christian Brabandt)
14 Files: src/misc1.c, src/testdir/test19.in, src/testdir/test19.ok
17 *** ../vim-7.3.300/src/misc1.c 2011-07-27 17:31:42.000000000 +0200
18 --- src/misc1.c 2011-09-07 19:37:04.000000000 +0200
22 /* Fill to next tabstop with a tab, if possible */
23 tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
24 ! if (todo >= tab_pad)
30 /* Fill to next tabstop with a tab, if possible */
31 tab_pad = (int)curbuf->b_p_ts - (ind_done % (int)curbuf->b_p_ts);
32 ! if (todo >= tab_pad && !curbuf->b_p_et)
40 /* Add tabs required for indent */
41 ! while (todo >= (int)curbuf->b_p_ts)
43 todo -= (int)curbuf->b_p_ts;
48 /* Add tabs required for indent */
49 ! while (todo >= (int)curbuf->b_p_ts && !curbuf->b_p_et)
51 todo -= (int)curbuf->b_p_ts;
53 *** ../vim-7.3.300/src/testdir/test19.in 2010-08-15 21:57:29.000000000 +0200
54 --- src/testdir/test19.in 2011-09-07 19:46:17.000000000 +0200
59 :" Test replacing with Tabs
61 + :" Test that copyindent works with expandtab set
62 + :set expandtab smartindent copyindent ts=8 sw=8 sts=8
63 + :exe "norm! o{\<cr>x"
64 :?^start?,$w! test.out
67 *** ../vim-7.3.300/src/testdir/test19.ok 2010-08-15 21:57:29.000000000 +0200
68 --- src/testdir/test19.ok 2011-09-07 19:37:04.000000000 +0200
77 *** ../vim-7.3.300/src/version.c 2011-09-07 19:30:17.000000000 +0200
78 --- src/version.c 2011-09-07 19:38:48.000000000 +0200
82 { /* Add new patch number below this line */
88 I recommend ordering large cargo containers of paper towels to make up
89 whatever budget underruns you have. Paper products are always useful and they
90 have the advantage of being completely flushable if you need to make room in
91 the storage area later.
92 (Scott Adams - The Dilbert principle)
94 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
95 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
96 \\\ an exciting new programming language -- http://www.Zimbu.org ///
97 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///