Open OdatNurd opened 3 years ago
Hi @OdatNurd,
Thanks for the feedback - the first issue mentioned in the description has been resolved as of Sublime Merge Build 2035. Currently we don't support the snippet-style syntax for selectors, though it's something we'd like to eventually add.
I'll leave this issue open in the meantime to track the request for snippet-style syntax support.
Kind regards, - Dylan
Version info
Description
The new selector variables behave in a bit of an inconsistent and/or unexpected manner, particularly as compared to how someone familiar with similar variable uses in Sublime Text might attempt to use them.
$text
causes it to use the literal text$text
in the command when executed, when one would expect that it would expand to nothing.Steps to reproduce
Create and save the following simplistic Python script, which displays its arguments when executed:
Add an alias to git's config that will execute this script, passing on the first argument:
Create a new command palette entry that invokes the git alias using
$text
as the first argument:something
has the desired effect; when checking the command output, we can see that the command executed as expected:Executing the command again, don't enter any value for the variable and just run it. The command preview shows that
git script $text
will be executed, and verifiably this is exactly what happens; however one might expect that if they provide no input, that's what$text
will expand to.The display of the command as
git script $'$text'
is also a bit confusing in this case (when you don't expect it)If you're used to similar constructs in Sublime Text, you might try to use
${text}
in place of$text
as the name of the variable; however in doing so the command does not parse and doesn't appear in the command palette at all. No message appears in the console as a warning that something is wrong in this case.Despite the above, replacing the variable with
${text:default}
, presuming that a default value for the variable will be used, does indeed work. You're not prompted for the value and the default is used directly when you invoke the command:Expected behavior
Variables like
$text
should expand out to the value that you gave, which includes no value at all.Also, arguably since many users that use Merge may also be using Text, having a similar syntax for a similar item seems like it would make the most sense so that skills