Skip to content

Commit

Permalink
Fix template cursor start
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Aug 17, 2024
1 parent 12ced96 commit 287c271
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ public void setCallback(final GsCallback.a1<File> callback) {
private Pair<String, Integer> getTemplateContent(final String template, final String name) {
String text = TextViewUtils.interpolateSnippet(template, name, "");

final int startingIndex = template.indexOf(HighlightingEditor.PLACE_CURSOR_HERE_TOKEN);
text = text.replace(HighlightingEditor.PLACE_CURSOR_HERE_TOKEN, "");
final int startingIndex = text.indexOf(HighlightingEditor.PLACE_CURSOR_HERE_TOKEN);
text = text.replaceAll(HighlightingEditor.PLACE_CURSOR_HERE_TOKEN, "");

// Has no utility in a new file
text = text.replace(HighlightingEditor.INSERT_SELECTION_HERE_TOKEN, "");
text = text.replaceAll(HighlightingEditor.INSERT_SELECTION_HERE_TOKEN, "");

return Pair.create(text, startingIndex);
}
Expand Down

0 comments on commit 287c271

Please sign in to comment.