Skip to content

Improvements to snippets with multiple lines from the same file  #2385

Closed
@shaedrich

Description

@shaedrich

Description

Let's assume, we have a snippet, where we want to "collapse" the middle part

// we want this line
    // we don't want this line
    // we want this line

Currently, this can only be done with the block format

```
--8<--
my_file:1:1
my_file:3:3
--8<--
```

Benefits

It works but it could be improved

  • It would be just handy if we could write something like this
--8<-- "my_file:1,3"

or even something like

--8<-- "my_other_file:1:2,4:5"

Solution Idea

  • But where it really would be without any alternative, is when using with auto dedention (Unindent for snippets #1945). Line 3 would always be incorrectly be dedented. This could, if the previous solution is not wanted, be done by taking all snippets from the same file into account but I can see that this is not a very

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions