Lej77 / tab-count-in-window-title

6 stars 1 forks source link

Feature request: Add markup for text that appears only if a substitution has value #2

Closed a2sheppy closed 5 years ago

a2sheppy commented 5 years ago

I would like to be able to set the window title prefix to [%TabCount%] for windows that have no %WindowName% set, and to [%TabCount%] • %WindowName % • for windows that do.

This could be done either by having two versions of the prefix or allowing some special markup to say that the enclosed text should only be included if the substitution(s) inside expand to have a value, like:

[%TabCount%]%% • %WindowName% •%%, where the double-% "%%" means "only if expansions all have content."

Lej77 commented 5 years ago

Version 4.7 of the extension introduces a new placeholder that makes this is possible. Your title prefix can be achieved with the following prefix: [%TabCount%] %IfWindowName( • %WindowName% • ,)%.