Fix %T filename pattern in fullscreen captures

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


Group Reviewers

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.


Test Plan

Test a fullscreen capture with the following pattern configured for file names:

Diff Detail

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

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

ngraham accepted this revision.Tue, Mar 17, 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.Tue, Mar 17, 12:23 AM