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

Change for more flexible templates #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ainslec
Copy link

@ainslec ainslec commented Jun 2, 2015

Currently, "autocomplete" allows templates to be used for autocompletes. The problem is that only one cursor tabstop can be used ( to signify the cursor resting place after completion), and any values specified as varnames are linked in the editor such that specifying a value for one "varname" will alter the values for all other varnames that share the same varname. Sometimes we want to be able to alter values independently but we want the same initial value.

This update adds the following syntaxes

Example 1:

${:replacement}${:replacement}${:replacement}

In the above example, there will be three tabstops showing "replacment" (without the colon). If the colon was not specified then typing in the highlighted area would alter all three "replacement" fields, with the colon, now there are three replacements to modify across the three tabstops. Typing in one will not affect the others.

Alteration 2:

Allow the '}' character in varnames.

Example:

${:}}

This will create a tabstop showing an initial value of "}" (without quotes). The value of this change is that sometimes the tabestop may require values that include braced brackets but currently, rbrace is not supported as a template value. With the escaped rbrace, it allows a full range of template values.

NOTE :: This change brings "Autocomplete" on-par with Ace editors autocomplete templating facilities.

Currently, "autocomplete" allows templates to be used for autocompletes. The problem is that only one cursor tabstop can be used ( to signify the cursor resting place after completion), and any values specified as varnames are linked in the editor such that specifying a value for one "varname" will alter the values for all other varnames that share the same varname. Sometimes we want to be able to alter values independently but we want the same initial value.

This update adds the following syntaxes

Example 1:

${:replacement}${:replacement}${:replacement}

In the above example, there will be three tabstops showing "replacment" (without the colon). If the colon was not specified then typing in the highlighted area would alter all three "replacement" fields, with the colon, now there are three replacements to modify across the three tabstops. Typing in one will not affect the others.

Alteration 2:

Allow the '}' character in varnames.

Example:

${:\}}

This will create a tabstop showing an initial value of "}" (without quotes). The value of this change is that sometimes the tabestop may require values that include braced brackets but currently, rbrace is not supported as a template value. With the escaped rbrace, it allows a full range of template values.
Support non-linked template values
@bobbylight bobbylight self-assigned this Nov 21, 2019
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.

None yet

2 participants