Skip to content

Commit 20d3e2d

Browse files
committed
folding highlight setting (for microsoft#83983)
1 parent df48af1 commit 20d3e2d

6 files changed

Lines changed: 61 additions & 230 deletions

File tree

build/yarn.lock

Lines changed: 9 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,6 @@ ansi-styles@^2.2.1:
392392
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
393393
integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=
394394

395-
ansi-styles@^3.2.1:
396-
version "3.2.1"
397-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
398-
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
399-
dependencies:
400-
color-convert "^1.9.0"
401-
402395
ansi-wrap@0.1.0:
403396
version "0.1.0"
404397
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
@@ -522,15 +515,6 @@ azure-storage@^2.1.0:
522515
xml2js "0.2.7"
523516
xmlbuilder "0.4.3"
524517

525-
babel-code-frame@^6.22.0:
526-
version "6.26.0"
527-
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
528-
integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=
529-
dependencies:
530-
chalk "^1.1.3"
531-
esutils "^2.0.2"
532-
js-tokens "^3.0.2"
533-
534518
balanced-match@^1.0.0:
535519
version "1.0.0"
536520
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
@@ -604,17 +588,12 @@ buffer-from@^1.0.0:
604588
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
605589
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
606590

607-
builtin-modules@^1.1.1:
608-
version "1.1.1"
609-
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
610-
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
611-
612591
caseless@~0.12.0:
613592
version "0.12.0"
614593
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
615594
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
616595

617-
chalk@^1.0.0, chalk@^1.1.3:
596+
chalk@^1.0.0:
618597
version "1.1.3"
619598
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
620599
integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
@@ -625,15 +604,6 @@ chalk@^1.0.0, chalk@^1.1.3:
625604
strip-ansi "^3.0.0"
626605
supports-color "^2.0.0"
627606

628-
chalk@^2.3.0:
629-
version "2.4.1"
630-
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
631-
integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==
632-
dependencies:
633-
ansi-styles "^3.2.1"
634-
escape-string-regexp "^1.0.5"
635-
supports-color "^5.3.0"
636-
637607
cheerio@^1.0.0-rc.1:
638608
version "1.0.0-rc.2"
639609
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db"
@@ -666,18 +636,6 @@ code-block-writer@9.4.1:
666636
resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-9.4.1.tgz#1448fca79dfc7a3649000f4c85be6bc770604c4c"
667637
integrity sha512-LHAB+DL4YZDcwK8y/kAxZ0Lf/ncwLh/Ux4cTVWbPwIdrf1gPxXiPcwpz8r8/KqXu1aD+Raz46EOxDjFlbyO6bA==
668638

669-
color-convert@^1.9.0:
670-
version "1.9.3"
671-
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
672-
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
673-
dependencies:
674-
color-name "1.1.3"
675-
676-
color-name@1.1.3:
677-
version "1.1.3"
678-
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
679-
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
680-
681639
color-support@^1.1.3:
682640
version "1.1.3"
683641
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
@@ -712,16 +670,16 @@ command-line-args@^5.1.1:
712670
lodash.camelcase "^4.3.0"
713671
typical "^4.0.0"
714672

715-
commander@^2.12.1, commander@^2.8.1:
716-
version "2.19.0"
717-
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
718-
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
719-
720673
commander@^2.20.0, commander@~2.20.0:
721674
version "2.20.0"
722675
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
723676
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
724677

678+
commander@^2.8.1:
679+
version "2.19.0"
680+
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
681+
integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
682+
725683
concat-map@0.0.1:
726684
version "0.0.1"
727685
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -856,11 +814,6 @@ diagnostic-channel@0.2.0:
856814
dependencies:
857815
semver "^5.3.0"
858816

859-
diff@^3.2.0:
860-
version "3.5.0"
861-
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
862-
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==
863-
864817
dir-glob@^3.0.1:
865818
version "3.0.1"
866819
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
@@ -940,7 +893,7 @@ entities@^1.1.1, entities@~1.1.1:
940893
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
941894
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
942895

943-
escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
896+
escape-string-regexp@^1.0.2:
944897
version "1.0.5"
945898
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
946899
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
@@ -958,11 +911,6 @@ eslint-visitor-keys@^1.1.0:
958911
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
959912
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
960913

961-
esprima@^4.0.0:
962-
version "4.0.1"
963-
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
964-
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
965-
966914
esrecurse@^4.1.0:
967915
version "4.2.1"
968916
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf"
@@ -975,11 +923,6 @@ estraverse@^4.1.0, estraverse@^4.1.1:
975923
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
976924
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
977925

978-
esutils@^2.0.2:
979-
version "2.0.2"
980-
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
981-
integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=
982-
983926
execa@^1.0.0:
984927
version "1.0.0"
985928
resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8"
@@ -1143,7 +1086,7 @@ glob-parent@^5.0.0:
11431086
dependencies:
11441087
is-glob "^4.0.1"
11451088

1146-
glob@^7.0.6, glob@^7.1.1:
1089+
glob@^7.0.6:
11471090
version "7.1.3"
11481091
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
11491092
integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==
@@ -1315,11 +1258,6 @@ has-ansi@^2.0.0:
13151258
dependencies:
13161259
ansi-regex "^2.0.0"
13171260

1318-
has-flag@^3.0.0:
1319-
version "3.0.0"
1320-
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
1321-
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
1322-
13231261
has-gulplog@^0.1.0:
13241262
version "0.1.0"
13251263
resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce"
@@ -1528,19 +1466,6 @@ isstream@~0.1.2:
15281466
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
15291467
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
15301468

1531-
js-tokens@^3.0.2:
1532-
version "3.0.2"
1533-
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
1534-
integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=
1535-
1536-
js-yaml@^3.7.0:
1537-
version "3.12.0"
1538-
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
1539-
integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==
1540-
dependencies:
1541-
argparse "^1.0.7"
1542-
esprima "^4.0.0"
1543-
15441469
jsbn@~0.1.0:
15451470
version "0.1.1"
15461471
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
@@ -1982,11 +1907,6 @@ path-key@^2.0.0, path-key@^2.0.1:
19821907
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
19831908
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
19841909

1985-
path-parse@^1.0.5:
1986-
version "1.0.6"
1987-
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
1988-
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
1989-
19901910
path-type@^4.0.0:
19911911
version "4.0.0"
19921912
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
@@ -2185,13 +2105,6 @@ resolve-url@^0.2.1:
21852105
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
21862106
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
21872107

2188-
resolve@^1.3.2:
2189-
version "1.8.1"
2190-
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
2191-
integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==
2192-
dependencies:
2193-
path-parse "^1.0.5"
2194-
21952108
reusify@^1.0.0:
21962109
version "1.0.4"
21972110
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
@@ -2388,13 +2301,6 @@ supports-color@^2.0.0:
23882301
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
23892302
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
23902303

2391-
supports-color@^5.3.0:
2392-
version "5.5.0"
2393-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
2394-
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
2395-
dependencies:
2396-
has-flag "^3.0.0"
2397-
23982304
terser@*:
23992305
version "4.2.1"
24002306
resolved "https://registry.yarnpkg.com/terser/-/terser-4.2.1.tgz#1052cfe17576c66e7bc70fcc7119f22b155bdac1"
@@ -2468,7 +2374,7 @@ ts-morph@^3.1.3:
24682374
multimatch "^4.0.0"
24692375
typescript "^3.0.1"
24702376

2471-
tslib@^1.8.0, tslib@^1.8.1:
2377+
tslib@^1.8.1:
24722378
version "1.9.3"
24732379
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
24742380
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
@@ -2478,31 +2384,6 @@ tslib@^1.9.3:
24782384
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
24792385
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
24802386

2481-
tslint@^5.9.1:
2482-
version "5.11.0"
2483-
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.11.0.tgz#98f30c02eae3cde7006201e4c33cb08b48581eed"
2484-
integrity sha1-mPMMAurjzecAYgHkwzywi0hYHu0=
2485-
dependencies:
2486-
babel-code-frame "^6.22.0"
2487-
builtin-modules "^1.1.1"
2488-
chalk "^2.3.0"
2489-
commander "^2.12.1"
2490-
diff "^3.2.0"
2491-
glob "^7.1.1"
2492-
js-yaml "^3.7.0"
2493-
minimatch "^3.0.4"
2494-
resolve "^1.3.2"
2495-
semver "^5.3.0"
2496-
tslib "^1.8.0"
2497-
tsutils "^2.27.2"
2498-
2499-
tsutils@^2.27.2:
2500-
version "2.29.0"
2501-
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
2502-
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
2503-
dependencies:
2504-
tslib "^1.8.1"
2505-
25062387
tsutils@^3.17.1:
25072388
version "3.17.1"
25082389
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"

src/vs/editor/common/config/editorOptions.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ export interface IEditorOptions {
465465
*/
466466
codeActionsOnSaveTimeout?: number;
467467
/**
468-
* Enable code folding
468+
* Enable code folding.
469469
* Defaults to true.
470470
*/
471471
folding?: boolean;
@@ -474,6 +474,11 @@ export interface IEditorOptions {
474474
* Defaults to 'auto'.
475475
*/
476476
foldingStrategy?: 'auto' | 'indentation';
477+
/**
478+
* Enable highlight for folded regions.
479+
* Defaults to true.
480+
*/
481+
foldingHighlight?: boolean;
477482
/**
478483
* Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
479484
* Defaults to 'mouseover'.
@@ -3083,6 +3088,7 @@ export const enum EditorOption {
30833088
fixedOverflowWidgets,
30843089
folding,
30853090
foldingStrategy,
3091+
foldingHighlight,
30863092
fontFamily,
30873093
fontInfo,
30883094
fontLigatures,
@@ -3350,6 +3356,10 @@ export const EditorOptions = {
33503356
['auto', 'indentation'] as const,
33513357
{ markdownDescription: nls.localize('foldingStrategy', "Controls the strategy for computing folding ranges. `auto` uses a language specific folding strategy, if available. `indentation` uses the indentation based folding strategy.") }
33523358
)),
3359+
foldingHighlight: register(new EditorBooleanOption(
3360+
EditorOption.foldingHighlight, 'foldingHighlight', true,
3361+
{ description: nls.localize('foldingHighlight', "Controls whether the editor should highlight folded ranges.") }
3362+
)),
33533363
fontFamily: register(new EditorStringOption(
33543364
EditorOption.fontFamily, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily,
33553365
{ description: nls.localize('fontFamily', "Controls the font family.") }

src/vs/editor/contrib/folding/folding.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export class FoldingController extends Disposable implements IEditorContribution
5959

6060
private readonly editor: ICodeEditor;
6161
private _isEnabled: boolean;
62-
private _autoHideFoldingControls: boolean;
6362
private _useFoldingProviders: boolean;
6463

6564
private readonly foldingDecorationProvider: FoldingDecorationProvider;
@@ -89,7 +88,6 @@ export class FoldingController extends Disposable implements IEditorContribution
8988
this.editor = editor;
9089
const options = this.editor.getOptions();
9190
this._isEnabled = options.get(EditorOption.folding);
92-
this._autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';
9391
this._useFoldingProviders = options.get(EditorOption.foldingStrategy) !== 'indentation';
9492

9593
this.foldingModel = null;
@@ -103,32 +101,30 @@ export class FoldingController extends Disposable implements IEditorContribution
103101
this.mouseDownInfo = null;
104102

105103
this.foldingDecorationProvider = new FoldingDecorationProvider(editor);
106-
this.foldingDecorationProvider.autoHideFoldingControls = this._autoHideFoldingControls;
104+
this.foldingDecorationProvider.autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';
105+
this.foldingDecorationProvider.showFoldingHighlights = options.get(EditorOption.foldingHighlight);
107106
this.foldingEnabled = CONTEXT_FOLDING_ENABLED.bindTo(this.contextKeyService);
108107
this.foldingEnabled.set(this._isEnabled);
109108

110109
this._register(this.editor.onDidChangeModel(() => this.onModelChanged()));
111110

112111
this._register(this.editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {
113-
if (e.hasChanged(EditorOption.folding) || e.hasChanged(EditorOption.showFoldingControls) || e.hasChanged(EditorOption.foldingStrategy)) {
114-
let oldIsEnabled = this._isEnabled;
112+
if (e.hasChanged(EditorOption.folding)) {
115113
const options = this.editor.getOptions();
116114
this._isEnabled = options.get(EditorOption.folding);
117115
this.foldingEnabled.set(this._isEnabled);
118-
if (oldIsEnabled !== this._isEnabled) {
119-
this.onModelChanged();
120-
}
121-
let oldShowFoldingControls = this._autoHideFoldingControls;
122-
this._autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';
123-
if (oldShowFoldingControls !== this._autoHideFoldingControls) {
124-
this.foldingDecorationProvider.autoHideFoldingControls = this._autoHideFoldingControls;
125-
this.onModelContentChanged();
126-
}
127-
let oldUseFoldingProviders = this._useFoldingProviders;
116+
this.onModelChanged();
117+
}
118+
if (e.hasChanged(EditorOption.showFoldingControls) || e.hasChanged(EditorOption.foldingHighlight)) {
119+
const options = this.editor.getOptions();
120+
this.foldingDecorationProvider.autoHideFoldingControls = options.get(EditorOption.showFoldingControls) === 'mouseover';
121+
this.foldingDecorationProvider.showFoldingHighlights = options.get(EditorOption.foldingHighlight);
122+
this.onModelContentChanged();
123+
}
124+
if (e.hasChanged(EditorOption.foldingStrategy)) {
125+
const options = this.editor.getOptions();
128126
this._useFoldingProviders = options.get(EditorOption.foldingStrategy) !== 'indentation';
129-
if (oldUseFoldingProviders !== this._useFoldingProviders) {
130-
this.onFoldingStrategyChanged();
131-
}
127+
this.onFoldingStrategyChanged();
132128
}
133129
}));
134130
this.onModelChanged();

0 commit comments

Comments
 (0)