Problem: The effect of adding "#" to 'cinoptions' is not always removed.
(David Briscoe)
Solution: Reset b_ind_hash_comment. (Christian Brabandt, closes #1475)
test_channel \
test_charsearch \
test_changedtick \
+ test_cindent \
test_cmdline \
test_command_count \
test_crypt \
* while(). */
buf->b_ind_if_for_while = 0;
+ /* indentation for # comments */
+ buf->b_ind_hash_comment = 0;
+
for (p = buf->b_p_cino; *p; )
{
l = p++;
test_cdo.res \
test_channel.res \
test_charsearch.res \
+ test_cindent.res \
test_cmdline.res \
test_command_count.res \
test_crypt.res \
/* vim: set cin ts=4 sw=4 : */
-Test for 'cindent'
+Test for 'cindent'.
+For new tests, consider putting them in test_cindent.vim.
STARTTEST
:so small.vim
--- /dev/null
+" Test for cinoptions and cindent
+"
+" TODO: rewrite test3.in into this new style test
+
+func Test_cino_hash()
+ " Test that curbuf->b_ind_hash_comment is correctly reset
+ new
+ setlocal cindent cinoptions=#1
+ setlocal cinoptions=
+ call setline(1, ["#include <iostream>"])
+ call cursor(1, 1)
+ norm! o#include
+ "call feedkeys("o#include\<esc>", 't')
+ call assert_equal(["#include <iostream>", "#include"], getline(1,2))
+ bwipe!
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 423,
/**/
422,
/**/