Fix %T filename pattern in fullscreen captures
AcceptedPublic

Authored by aureliencouderc on Mar 10 2020, 12:34 PM.

Details

Reviewers
ngraham
Group Reviewers
Spectacle
Summary

The %T pattern can be used in file names to add the title of the window being captured. In case of fullscreen capture when there is no title spectacles removes this pattern, but also surrounding separators.

Unfortunately it is too agressive in removing separators and will also eat the % character of the closest following pattern in some cases. This breaks patterns like %T_%Y-%M-%D_%H%m%S.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953536

Test Plan

Test a fullscreen capture with the following pattern configured for file names:
%T_%Y-%M-%D_%H%m%S

Diff Detail

Repository
R166 Spectacle
Lint
Lint Skipped
Unit
Unit Tests Skipped
Restricted Application added a project: Spectacle. · View Herald TranscriptMar 10 2020, 12:34 PM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
aureliencouderc requested review of this revision.Mar 10 2020, 12:34 PM
davidre added a subscriber: davidre.EditedMar 10 2020, 12:53 PM

Nice catch!
Could you please add a test case for that?

ngraham accepted this revision.Mar 17 2020, 12:23 AM
ngraham added a subscriber: ngraham.

Looks and behaves nicely to me, but I am not a regex expert by any stretch of the imagination. @davidre, does this look okay to you?

This revision is now accepted and ready to land.Mar 17 2020, 12:23 AM