Skip to content

Commit 174fe0d

Browse files
committed
add additional check in TextFormatter#getSequence
1 parent 13b238e commit 174fe0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/textFormatter/TextFormatter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,14 @@ else if (TextFormatter.startWithDefaultColorIfNotDefined && this.parent == null)
370370
* If {@link #debug} is set to {@code true}, then the text "ESC" will be used instead of the actual escape
371371
* character.
372372
* </p>
373+
* If {@link #enableSequences} is set to {@code false}, then an empty string will be returned.
373374
* @param values The values to add to the terminal sequence.
374375
* @return a string with a terminal sequence with the specified values
375376
*/
376377
public static @NotNull String getSequence(@NotNull Object... values) {
378+
if (!TextFormatter.enableSequences)
379+
return "";
380+
377381
var joined = String.join(
378382
";",
379383
Arrays.stream(values)

0 commit comments

Comments
 (0)