To: vim_dev@googlegroups.com Subject: Patch 8.0.0851 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0851 Problem: 'smartindent' is used even when 'indentexpr' is set. Solution: Ignore 'smartindent' when 'indentexpr' is set. (Hirohito Higashi) Files: src/misc1.c, src/testdi/test_smartindent.vim *** ../vim-8.0.0850/src/misc1.c 2017-07-16 15:48:39.999132068 +0200 --- src/misc1.c 2017-08-03 17:44:30.244747581 +0200 *************** *** 627,632 **** --- 627,635 ---- # ifdef FEAT_CINDENT && !curbuf->b_p_cin # endif + # ifdef FEAT_EVAL + && *curbuf->b_p_inde == NUL + # endif ); int no_si = FALSE; /* reset did_si afterwards */ int first_char = NUL; /* init for GCC */ *** ../vim-8.0.0850/src/testdir/test_smartindent.vim 2016-09-07 20:37:01.000000000 +0200 --- src/testdir/test_smartindent.vim 2017-08-03 17:53:54.612611446 +0200 *************** *** 1,3 **** --- 1,4 ---- + " Tests for smartindent " Tests for not doing smart indenting when it isn't set. function! Test_nosmartindent() *************** *** 12,14 **** --- 13,41 ---- call assert_equal(" #test", getline(1)) enew! | close endfunction + + function MyIndent() + endfunction + + " When 'indentexpr' is set, setting 'si' has no effect. + function Test_smartindent_has_no_effect() + new + exe "normal! i\one\" + set noautoindent + set smartindent + set indentexpr= + exe "normal! Gotwo\" + call assert_equal("\ttwo", getline("$")) + + set indentexpr=MyIndent + exe "normal! Gothree\" + call assert_equal("three", getline("$")) + + delfunction! MyIndent + set autoindent& + set smartindent& + set indentexpr& + bwipe! + endfunction + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.0.0850/src/version.c 2017-08-03 17:37:44.547737719 +0200 --- src/version.c 2017-08-03 17:44:04.088940414 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 851, /**/ -- Q: How many hardware engineers does it take to change a lightbulb? A: None. We'll fix it in software. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///