Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippet token for inserting selection (closes #2059) #2081

Closed
wants to merge 3 commits into from

Conversation

harshad1
Copy link
Collaborator

@harshad1 harshad1 commented Aug 4, 2023

This addresses #2059

The token %%INSERT_SELECTION_HERE%% will be replaced with any selected text. This token can be used multiple times.

@harshad1
Copy link
Collaborator Author

harshad1 commented Aug 4, 2023

@gsantner

I am not a fan of the %%FOO_BAR%% token format. Do you have any alternative ideas. Shorter tokens would be nicer too

@gsantner
Copy link
Owner

gsantner commented Aug 5, 2023

@harshad1
At the end it has to be something that doesn't conflict with text users might have as real text in it. And what's quite common for these kind of things are {{token}} / %token% / %%token%%. Though as you shouldn't be creating templates again and again I think it shouldn't matter that much, you place it like once and that#s it.

Comment on lines 193 to +197

@Override
public boolean bringPointIntoView(int i) {
return super.bringPointIntoView(i);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this? As far I see it's a override that just calls the original implementation

@gsantner gsantner changed the title Token for inserting selection Snippet token for inserting selection (closes #2059) Aug 14, 2023
@harshad1
Copy link
Collaborator Author

NOTE: this code got included in the line numbers branch.

@harshad1
Copy link
Collaborator Author

Closed as this is included in #2090

@harshad1 harshad1 closed this Aug 23, 2023
@harshad1 harshad1 deleted the selected_text_in_snippet branch October 10, 2023 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants