Skip to content

Commit

Permalink
uuid support
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Nov 9, 2023
1 parent b802182 commit 680b4dd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.List;
import java.util.Locale;
import java.util.TreeSet;
import java.util.UUID;

@SuppressWarnings({"CharsetObjectCanBeUsed", "WeakerAccess", "unused"})
public final class TextViewUtils extends GsTextUtils {
Expand Down Expand Up @@ -424,6 +425,10 @@ public static String interpolateSnippet(String text, final String title, final S
.replace("{{sel}}", selectedText)
.replace("{{cursor}}", HighlightingEditor.PLACE_CURSOR_HERE_TOKEN);

while (text.contains("{{uuid}}")) {
text = text.replaceFirst("\\{\\{uuid\\}\\}", UUID.randomUUID().toString());
}

return interpolateEscapedDateTime(text);
}

Expand Down

0 comments on commit 680b4dd

Please sign in to comment.