diff src/testdir/test_cindent.vim @ 28353:8bc8071928ed v8.2.4702

patch 8.2.4702: C++ scope labels are hard-coded Commit: https://github.com/vim/vim/commit/3506cf34c17c5eae6c2d1317db1fcd5a8493c288 Author: Tom Praschan <13141438+tom-anders@users.noreply.github.com> Date: Thu Apr 7 12:39:08 2022 +0100 patch 8.2.4702: C++ scope labels are hard-coded Problem: C++ scope labels are hard-coded. Solution: Add 'cinscopedecls' to define the labels. (Rom Praschan, closes #10109)
author Bram Moolenaar <Bram@vim.org>
date Thu, 07 Apr 2022 13:45:04 +0200
parents 1095fd0dc362
children 85c2bbee17d0
line wrap: on
line diff
--- a/src/testdir/test_cindent.vim
+++ b/src/testdir/test_cindent.vim
@@ -5319,6 +5319,49 @@ func Test_cindent_change_multline()
   close!
 endfunc
 
+func Test_cindent_scopedecls()
+  new
+  setl cindent ts=4 sw=4
+  setl cino=g0
+  setl cinsd+=public\ slots,signals
+
+  let code =<< trim [CODE]
+  class Foo
+  {
+  public:
+  virtual void foo() = 0;
+  public slots:
+  void onBar();
+  signals:
+  void baz();
+  private:
+  int x;
+  };
+  [CODE]
+
+  call append(0, code)
+  normal gg
+  normal ]]=][
+
+  let expected =<< trim [CODE]
+  class Foo
+  {
+  public:
+	virtual void foo() = 0;
+  public slots:
+	void onBar();
+  signals:
+	void baz();
+  private:
+	int x;
+  };
+
+  [CODE]
+
+  call assert_equal(expected, getline(1, '$'))
+  enew! | close
+endfunc
+
 func Test_cindent_pragma()
   new
   setl cindent ts=4 sw=4