Community
    • Login

    [Feature] double-click on PHP variable name to select '$' as well as character part

    Scheduled Pinned Locked Moved General Discussion
    phpphp variables
    2 Posts 2 Posters 1.7k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • alanrewA Offline
      alanrew
      last edited by

      If I specify that the language in a file is PHP, I’d like np++ to select the entire variable name
      $name

      when I double-click on it, not just the ‘name’ part.

      PhpStorm, for example, does this & it seems the natural thing to do.

      Would really appreciate this.

      1 Reply Last reply Reply Quote 1
      • guy038G Offline
        guy038
        last edited by guy038

        Hello, @alanrew,

        Starting with the 7.3.1 version of N++, you can change the default word characters list ( any character matched by the regex \w )

        • Select the menu option Settings > Preferences… > Delimiter > Word character List

        • Click on the choice : Add your character as part of word

        • Type in the $ character, in the field

        • Close the Preferences dialog

        Et voilà !

        Remarks :

        • Strangely, the regex \w, still, does NOT match the $ symbol !?. Therefore, a PHP variable name should be matched with the regex \$\w+

        • A double-click on words , containing the $ symbol or ending with it will, also, select them !

        Best Regards

        guy038

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors