Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
28352:10886e23615f | 28353:8bc8071928ed |
---|---|
5317 normal! jc3jm = 2; | 5317 normal! jc3jm = 2; |
5318 call assert_equal("\tm = 2;", getline(2)) | 5318 call assert_equal("\tm = 2;", getline(2)) |
5319 close! | 5319 close! |
5320 endfunc | 5320 endfunc |
5321 | 5321 |
5322 func Test_cindent_scopedecls() | |
5323 new | |
5324 setl cindent ts=4 sw=4 | |
5325 setl cino=g0 | |
5326 setl cinsd+=public\ slots,signals | |
5327 | |
5328 let code =<< trim [CODE] | |
5329 class Foo | |
5330 { | |
5331 public: | |
5332 virtual void foo() = 0; | |
5333 public slots: | |
5334 void onBar(); | |
5335 signals: | |
5336 void baz(); | |
5337 private: | |
5338 int x; | |
5339 }; | |
5340 [CODE] | |
5341 | |
5342 call append(0, code) | |
5343 normal gg | |
5344 normal ]]=][ | |
5345 | |
5346 let expected =<< trim [CODE] | |
5347 class Foo | |
5348 { | |
5349 public: | |
5350 virtual void foo() = 0; | |
5351 public slots: | |
5352 void onBar(); | |
5353 signals: | |
5354 void baz(); | |
5355 private: | |
5356 int x; | |
5357 }; | |
5358 | |
5359 [CODE] | |
5360 | |
5361 call assert_equal(expected, getline(1, '$')) | |
5362 enew! | close | |
5363 endfunc | |
5364 | |
5322 func Test_cindent_pragma() | 5365 func Test_cindent_pragma() |
5323 new | 5366 new |
5324 setl cindent ts=4 sw=4 | 5367 setl cindent ts=4 sw=4 |
5325 setl cino=Ps | 5368 setl cino=Ps |
5326 | 5369 |