summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cindent.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-31 17:49:30 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-31 17:49:30 +0200
commitd881b516da0184052d2f9d33c3f72c5c014316bd (patch)
treefaadc52b11a24da6c1ba2b147fd1f7a061198e88 /src/testdir/test_cindent.vim
parente023e88bed3f2e0a7ea4cf10cac2de80bc9c271c (diff)
patch 8.2.0864: pragmas are indented all the way to the leftv8.2.0864
Problem: Pragmas are indented all the way to the left. Solution: Add an option to indent progmas like normal code. (Max Rumpf, closes #5468)
Diffstat (limited to 'src/testdir/test_cindent.vim')
-rw-r--r--src/testdir/test_cindent.vim36
1 files changed, 36 insertions, 0 deletions
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