pls icon indicating copy to clipboard operation
pls copied to clipboard

RFE: Add an ability to define "smarter" collapses

Open JacobCallahan opened this issue 3 months ago • 1 comments

Problem

Collapses are a nice feature, especially for people that use specific backup patterns for files. However, all collapses need to be defined per-name in the config. This isn't really reasonable for things like backup files, where any file name could have a backup that should be nested.

Description

What I'd like to see is some way to describe a variable pattern that we could use when writing collapse rules. Maybe something like this.

  - capture_pattern: \*$  # some pattern to match all files or only ones a user wants 
    pattern: {capture_pattern}.bak$
    importance: -1
    collapse:
      name: {capture_pattern}

Alternatives

The only current alternative I know is to specify a separate collapse rule for each file you want to have collapsed.

Additional information

Current directory view

Image

Desired directory view (with "smart" collapse)

Image

JacobCallahan avatar Oct 03 '25 18:10 JacobCallahan

I see what you mean. It seems like a good feature to support. Just to be clear, pls does support another version of collapse that's based on extensions. That works to collapse .css files into their parent .scss files or .js files into their parent .ts files. It does what you want, up to some extent.

dhruvkb avatar Oct 05 '25 07:10 dhruvkb