From d881b516da0184052d2f9d33c3f72c5c014316bd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 31 May 2020 17:49:30 +0200 Subject: 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) --- src/testdir/test_cindent.vim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/testdir/test_cindent.vim') diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim index 9258192897..dc8c51dbfe 100644 --- 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 -- cgit v1.2.3