Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Double-click on PHP variable selects more than one #863
I have places in my code where I will include multiple variables in an output string:
echo "This is a sample $var1$var2$varx output.";
When double-clicking on one of these variables to select it, all three variables (in the example above) are selected instead. It seems that the desired behavior is to just select individual variables.
Thanks in advance!
I finally had some time to look into this and came to the conclusion that modifying the default double-click behavior is not a good idea. The only way to go about this is to prevent
This is a great suggestion. I think it should go out to the group for a vote (if that is even possible).
Personally, I prefer to have the $ not included in the double-click select. The reason being is that I always name local variables the same as my database field names. Here's a case:
$var_name = $my_db_array['var_name'];
When I am copying that line to add a new field name, I need to be careful when selecting text to include or not include the leading $, depending on what I am copying/pasting from/to. What is selected when double clicking the $var_name is different that what is selected when double clicking on the 'var_name'.
I am used to it other editors selecting the exact text "var_name" in both cases. Other developers may disagree with this approach. I definitely don't want to speak for all developers. This is just my personal preference.
Personally, I prefer to have the $ included in the selection. The use case of @seattledeveloper is a valid consideration, but I personally find it rarer that I need to remove the symbol than include it. It's a subtle difference, but it is one that I find distracting in practice when switching between Komodo and Brand X IDE.