How to include preceding $ (dollar sign) so that it's included in double-click selection?

How to include preceding $ (dollar sign) so that it's included in double-click selection?

7
NewbieNewbie
7

    Apr 02, 2018#1

    As things are, if I want to select a string (such as a variable name) that begins with a dollar sign, UltraEdit ignores the "$" and selects only the rest of the string, which is quite annoying when working with a programming language in which all variables must begin with "$" (primarily AutoIt).
    I tried adding the dollar sign in the set of delimiters in the settings (Editor -> Delimiters -> Left delimiters for Ctrl + Dbl Click), but that never works -- it still just ignores the "$" and selects the rest of the string.

    Since one of the best features of UltraEdit is that it is highly customizable, I can't help thinking there must be a way, but I cannot find one.  Does anyone have any solutions or suggestions to try?

    I'm running the latest version (v25.00.0.58) under 64-bit Windows 7 Pro and Windows 10 Pro.

    Thank you.

    6,686585
    Grand MasterGrand Master
    6,686585

      Apr 02, 2018#2

      Adding $ to delimiters for Ctrl+double click was a bad idea as it is results in the opposite of what you want, the dollar sign is not included on selecting a string with Ctrl+double click.

      Ctrl+double click is a customizable feature as coded in UltraEdit. Double click feature for selecting a word is a standard feature of used Windows library and is not customizable, except Microsoft has made the selection behavior customizable somewhere in Windows registry, but I am not aware of it. (It does not bother me as I select strings in UltraEdit always with keyboard and never using a pointing device. It is too inefficient for me to move one hand from keyboard to mouse, pointing stick or touch pad to select a string. So I have never searched if double click behavior can be customized somehow for all applications using this standard feature of Windows.)

      But it is possible to replace the command Select word with default hotkey assignment Ctrl+J by a macro with this or any other hotkey or chord (multi-key) assigned and stored (together with other macros) in a macro file which is configured to be automatically loaded on startup of UltraEdit to have the macros always available for usage after starting UltraEdit. The macro command for selecting a string consisting of word characters according to Unicode specification with additionally a non word character like the dollar sign is posted at forum topic Customize Select Word to include a dash, a dollar sign, or any other character as word char.

      Note: Assigning Ctrl+J to a macro which selects a word with additionally also a dollar sign does not really replace built-in Select word. So a simple double click still selects just a string consisting of word characters.

      Well, I have to add for completeness that the developers of UltraEdit enhanced the Select word feature a little bit by selecting a series of spaces/tabs when the user double clicks somewhere in middle of a series of spaces/tabs.
      Best regards from an UC/UE/UES for Windows user from Austria

      7
      NewbieNewbie
      7

        Apr 03, 2018#3

        Master Mofi, thank you so very much for your helpful reply – you are a great treasure here and presumably everywhere!

        I realized after I posted my OP that adding a dollar sign to the delimiters was indeed a terrible idea, but I was unable to get back here at that time and correct myself.

        I've created a few moderately complex UltraEdit macros before, so now it's just a matter of carefully reviewing your macro code to the point I feel I understand it well enough that I'm not just cutting and pasting it like a trained monkey...

        Thank you also for your exegesis of the Windows origin of this feature – that was quite unexpected, and is extremely helpful to know. I know my way around the registry pretty well, and perhaps with the help of someone at MSDN the mystery will be revealed. If I learn anything helpful, I will of course report back with that information.

        Thank you most sincerely once more!

        6,686585
        Grand MasterGrand Master
        6,686585

          May 26, 2018#4

          The third requested enhancement (configurable character set of word characters) based on the large enhancement request written by me was introduced with UltraEdit for Windows v25.00.0.82 and UEStudio v18.00.0.18 as documented on hotfix information pages for UE v25.00 and UES v18.00 with:
          • Added support for including leading $ when double-clicking variables in PHP files
          A string starting with non-word character $ like $variable is selected with including the dollar sign on
          • double clicking on $variable with pointing device;
          • pressing hokey Ctrl+J to select the word at current position of caret;
          • clicking in ribbon mode on ribbon tab Edit in first ribbon group Select and delete on down arrow of first item Select and next in popup menu on item Select word;
          • clicking in toolbar/menu mode with contemporary menus in menu Edit in submenu Select on menu item Select word;
          • clicking in toolbar/menu mode with traditional menus in menu Edit on menu item Select word.
          But $ is interpreted as word character anywhere within a string for selection only if the string is within a file or section syntax highlighted with a syntax highlighting language with language marker PHP_LANG which means the string must be part of a PHP code block according to syntax highlighting.

          Pressing Ctrl+F to open Quick find or Alt+F3 to open regular Find (with default key assignment) or Ctrl+R to open Replace or Ctrl+Shift+F to open Find in Files with caret anywhere within $variable results also in getting the variable with the dollar sign preset as string to find.

          The built-in enhancement for PHP code was removed in UE v25.10 and UES v18.10 because of /Word Select Include = feature introduced with those versions which makes it possible for every user to customize the word selection/navigation behavior for syntax highlighted files.
          Update on 2021-01-31:

          The first (configurable case matching behavior) and second (configurable whole word matching behavior) requested enhancements were introduced with UltraEdit for Windows v28.00 and UEStudio v21.00 offering at Advanced - Settings or Configuration - Search - Advanced for Highlight all occurrences of selected word the configuration settings:
          • Match case
          • Match whole word only
            • ... when selection is whole word only
          The settings give a user the full control on which strings are highlighted on double clicking a word without or with Shift hold or executing the command Highlighted all selected from ribbon/menu View or on pressing Ctrl+. without or with having something currently selected and no strings currently highlighted.
          Best regards from an UC/UE/UES for Windows user from Austria