Mercurial > vim
diff src/testdir/test_cindent.vim @ 20621:d30b16692ce0 v8.2.0864
patch 8.2.0864: pragmas are indented all the way to the left
Commit: https://github.com/vim/vim/commit/d881b516da0184052d2f9d33c3f72c5c014316bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 31 17:49:30 2020 +0200
patch 8.2.0864: pragmas are indented all the way to the left
Problem: Pragmas are indented all the way to the left.
Solution: Add an option to indent progmas like normal code. (Max Rumpf,
closes #5468)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 May 2020 18:00:03 +0200 |
parents | 9c15be376631 |
children | 08940efa6b4e |
line wrap: on
line diff
--- a/src/testdir/test_cindent.vim +++ b/src/testdir/test_cindent.vim @@ -5272,4 +5272,40 @@ func Test_cindent_change_multline() close! endfunc +func Test_cindent_pragma() + new + setl cindent ts=4 sw=4 + setl cino=Ps + + let code =<< trim [CODE] + { + #pragma omp parallel + { + #pragma omp task + foo(); + # pragma omp taskwait + } + } + [CODE] + + call append(0, code) + normal gg + normal =G + + let expected =<< trim [CODE] + { + #pragma omp parallel + { + #pragma omp task + foo(); + # pragma omp taskwait + } + } + + [CODE] + + call assert_equal(expected, getline(1, '$')) + enew! | close +endfunc + " vim: shiftwidth=2 sts=2 expandtab