Skip to content

[folding] highlight folded line #83983

Closed

Description

It would be useful if the collapsed lines were highlighted.

Actual code expanded:
0000000

Actual code collapsed:
11111

Proposal for an highlight of collapsed code:
22222
Perfect if with color highlight configurable on settings.

Thanks

Activity

  1. changed the title [-]Highlight of collapsed code[/-] [+][foling] highlight folded line[/+] on Nov 6, 2019
  2. changed the title [-][foling] highlight folded line[/-] [+][folding] highlight folded line[/+] on Nov 6, 2019
  3. added
    feature-request
    on Nov 6, 2019
  4. dbeigi commented on Nov 7, 2019

    @dbeigi
    Contributor

    Hi Martin Aeschlimann (@aeschli), I would like to give this a shot.

  5. aeschli commented on Nov 7, 2019

    @aeschli
    Contributor

    Daniel Beigi (@dbeigi) Great. Have a look at https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/folding/foldingModel.ts#L91
    There we create a decoration that is used not only for the +/- action but alsofor the ...
    Righ now it starts at the last character.
    A simple fix might be to have it start at character 0, and give it a background color

  6. dbeigi commented on Nov 8, 2019

    @dbeigi
    Contributor

    Martin Aeschlimann (@aeschli) appreciate the direction

  7. dbeigi commented on Nov 13, 2019

    @dbeigi
    Contributor

    Martin Aeschlimann (@aeschli) do you have any suggestions on adding the background color?

  8. aeschli commented on Nov 14, 2019

    @aeschli
    Contributor

    Stefano Consolaro (@mymage)

    private static readonly COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({
    defines a decoration that you can use to also add a background color:

    	private static readonly COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({
    		stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
    		afterContentClassName: 'inline-folded',
    		className: 'folded-background',
    		isWholeLine: true,
    		linesDecorationsClassName: 'codicon codicon-chevron-right'
    	});
    

    And in folding.css:

    .monaco-editor .folded-background {
    	background-color: yellow;
    }

    Now the remaining work is to make the color configurable.

    registerThemingParticipant((theme, collector) => {

    is an example on a css that is generated based on theme colors.

  9. added a commit that references this issue on Nov 16, 2019
    c5c723b
  10. mymage commented on Nov 16, 2019

    @mymage
    Author

    Martin Aeschlimann (@aeschli) , sorry I'm not very confident with these language: you intend that I can apply these code on my local files to try the feature?

  11. aeschli commented on Nov 18, 2019

    @aeschli
    Contributor

    Stefano Consolaro (@mymage) Sorry, no, this was just intended to help Daniel Beigi (@dbeigi) which offered to work on a PR implementing the feature.

  12. added a commit that references this issue on Dec 19, 2019
    3767978
  13. ianwesterfield commented on Jan 3, 2020

    @ianwesterfield

    Am I missing where this can be disabled in settings?
    Just saw the comment from Martin Aeschlimann (@aeschli) on PR #84955. What was the reasoning behind not requiring this be controlled by a setting? It's the first place I looked to disable the highlighting.

  14. usernamehw commented on Jan 3, 2020

    @usernamehw
    Contributor

    You can use transparent color:

    "workbench.colorCustomizations": {
    	"editor.foldBackground": "#fff0",
    }

    The reason is probably because there's a lot of settings already.

  15. aeschli commented on Jan 5, 2020

    @aeschli
    Contributor

    I added a setting editor.foldingHighlight

  16. aeschli commented on Jan 28, 2020

    @aeschli
    Contributor

    To verify:

    • configure folded region highlight color:
    "workbench.colorCustomizations": {
    	"editor.foldBackground": "#fff0",
    }
    
    • enable/disable feature:
      "editor.foldingHighlight": false
  17. locked and limited conversation to collaborators on Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-foldingfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions