Select PHP var without $ symbol


#1

Hi. I wish I could do double click in vars of PHP but only the text string variable was selected , but not the symbol ($) .

I searched but the solutions do not work I 've read. For Example:
Double click selection in PHP file (not work´s for me :frowning:

Thank you!


#2

I just tried it and it works just fine for me. Please screenshot your Non Word Characters field.


#3

Hi DamnedScholar!

Thanks!


#4

Try starting Atom from the command line with atom --safe and see if the selection works the same way. Also, what version of Atom and what OS are you running?

Right now, the problem can’t be replicated, and there’s no way to find out what’s causing an issue unless you can make the issue happen on demand.


#5

Try starting Atom from the command line with atom --safe and see if the selection works the same way. Also, what version of Atom and what OS are you running?

Not works with safe mode. Version of Atom (The last)-> 1.7.4
OSX Version-> 10.11.5

Right now, the problem can’t be replicated, and there’s no way to find
out what’s causing an issue unless you can make the issue happen on
demand.

OK thanks for the help!


#6

Nevermind, I’m pretty sure that I replicated it. Please follow my steps and see if you get similar results.

  • I removed @ from the Non Word Characters field.
  • My test document contains the text <?php $variable@ ?>
  • With PHP as the active grammar, double-clicking on any of the letters selects $variable.
  • With plain text as the active grammar, double-clicking selects $variable@.

This suggests that your problem was the grammar you had active in the file you were working with. It seems like the selection not only respects word characters, but also the underlying HTML that gets generated when the file is matched against the grammar. In the dev tools, the HTML of the relevant section is

<span class="meta embedded line php">
  <span class="punctuation section embedded begin php">&lt;?php</span>
  <span class="source php">
    <span class="variable other php">
      <span class="punctuation definition variable php">$</span>
      variable
    </span>
    <span class="keyword operator error-control php">@</span>
  </span>
  <span class="punctuation section embedded end php">
    <span class="source php">?</span>
  </span>
  <span class="punctuation section embedded end php">&gt;</span>
</span>

#7

Thanks, this setting is located in language-php package settings.