Skip to content

file-utilities: rework common prefix computation

Ghost User requested to merge (removed):new-folder-with-selection-prefix into master

Currently, the process for getting the common prefix of a list of file names is a tad too greedy:

  1. Find the common prefix of all the strings.
  2. Strip the extension from the prefix.
  3. Strip trailing punctuation.

Step 2 may strip dots if there’s trailing whitespace and step 3 may strip useful punctuation (e.g. parentheses). This commit reworks the process as such:

  1. Strip the extension from all the file names.
  2. Find the common prefix of all the strings.
  3. Trim trailing whitespace.

Fixes #174 (closed).

Edited by Ghost User

Merge request reports