PHP $_POST replaced by _POST on typing (solved)

PHP $_POST replaced by _POST on typing (solved)

8
NewbieNewbie
8

    Dec 17, 2014#1

    Hi. I searched the forum but couldn't find the answer for my question.

    First, I set the page to PHP in the view menu with View - View As - PHP.

    When I type $_P, the editor converts it to _POST. So, I can't type $_POST in the editor.

    Here is my code:

    Code: Select all

    <?php
        if (isset($_POST['customer_list'])) {
            $customer_list = [b]$_POST[/b]   <- replacement occurs
        }
    ?>
    How can I prevent it from doing that?

    I checked php.uew file in %APPDATA%\IDMComp\UEStudio\wordfiles. I couldn't find a clue.

    Any help will be greatly appreciated.
    Thank you in advance.

    6,685587
    Grand MasterGrand Master
    6,685587

      Re: PHP $_POST replaced by _POST on typing

      Dec 17, 2014#2

      First, with any file extension defined in html.uew or in php.uew in folder %APPDATA%\IDMComp\UEStudio\wordfiles\ a PHP code is syntax highlighted according to php.uew with caret being currently positioned inside the PHP code section. The currently active syntax highlighting according to caret position in active file is indicated in status bar at bottom of UEStudio window.

      I have enabled setting Auto-correct keywords at Advanced - Configuration - Editor Display - Miscellaneous as it is not enabled by default. The auto-correction feature is the only feature which results in changing something entered by the user in a file I'm currently aware of.

      My first suggestion is to disable this feature if you don't want to make use of it.

      My second suggestion is to simply undo an unwanted auto-correction by pressing Ctrl+Z or using Undo command from menu Edit or the toolbar.

      I'm using currently UE v21.30.0.1016 and UES v14.40.0.1012.

      I copied your code snippet into a new ANSI file and saved it as test.php. HTML is displayed in View - View as, but with caret inside PHP code block status bar displays PHP. So multi-language syntax highlighting worked. Then I enter $_POST and nothing changed. I converted the file to UTF-8 (Unicode editing) and entered once again $_POST. There was again no auto-correction.

      As language definition in php.uew as installed with UE v21.20.0.1009 to v21.30.0.1016 and also UES v14.40.0.1012 is case-insensitive and character $ is not a word delimiter, I don't see any reason why $_POST should be auto-corrected to _POST by UltraEdit or UEStudio.

      Which version of UEStudio do you use?

      And do you use php.uew installed with this version of UEStudio or is it from a previous version of UEStudio?
      Best regards from an UC/UE/UES for Windows user from Austria

      8
      NewbieNewbie
      8

        Re: PHP $_POST replaced by _POST on typing

        Dec 17, 2014#3

        Thank you so much for your help, Mofi.

        I am using UEStudio 14.40.0.1012, which is the latest version and this is my first time using it.

        I mean I have been using UE for many years but for this time, I just wanted to try UEStudio.

        I haven't touched uew files at all except the 2 changes in php.uew below.

        /Indent Strings = "no_unindent"
        /Unindent Strings = "no_unindent"

        Any suggestions?
        Thank you so much in advance.

        6,685587
        Grand MasterGrand Master
        6,685587

          Re: PHP $_POST replaced by _POST on typing

          Dec 17, 2014#4

          I think, I have found out what happens here.

          UEStudio has several features UltraEdit does not have to help a user to write code faster. Those features can be configured at Advanced - Configuration - IDE - IntelliTips.

          There is Auto-complete which is also available with less features in UltraEdit. I'm not sure, but I think this feature uses fixed [A-Za-z0-9_] as character set definition to find symbols. _POST is a symbol for the auto-complete feature.

          And there is Quick Tips supported only by UEStudio. I'm not sure, but I think this feature uses the word delimiters settings in syntax highlighting wordfiles to find "words" found in file.

          The Quick Tips feature is enabled with Scan back "x" chars with a value greater 0 and displays above currently typed $_P as tooltip the string $_POST found in the PHP code line above for being completed with key TAB or key ENTER. Therefore hitting one of those 2 keys after typing $_P results in getting $_POST inserted.

          But if additionally Show symbol list automatically in Auto-complete configuration dialog is also enabled, the auto-complete list window appears after typing $_P or $_PO depending on configured number of characters. But displayed in this list window is only _POST, the symbol name without $. Hitting now key TAB or ENTER results in replacing $_PO by just _POST. I suppose you hit key ENTER to insert a new line.

          You have several options to avoid this unwanted behavior:
          1. Uncheck auto-complete setting Show symbol list automatically. Then the auto-completion list window must be opened by explicitly hitting key combination Ctrl+Space.
          2. Or if automatic opening of auto-completion list window is nevertheless wanted, uncheck auto-complete setting Complete with Enter to insert suggested symbol from auto-completion list only with key TAB, but never with key ENTER or RETURN. This avoids inserting a symbol for the list on hitting ENTER or RETURN to make a line break.
          3. And last using auto-complete setting Auto-complete one-symbol list should not be enabled on writing PHP code to avoid the wrong completion as discussed here, except auto-completion list window is not automatically shown.
          The Quick Tips feature becomes active for $_P with first option taken to not automatically show the auto-completion list window.

          Hint: I suppose that many users disable those IntelliTips features on first occurrence of an unwanted behavior. But they make writing code with longer and therefore more meaningful symbols very efficient after having learned to make use of them. There is no real need anymore to use variables and functions with names consisting only of 1 to 4 letters. Longer symbol names are no problem on experienced use of those features.
          Best regards from an UC/UE/UES for Windows user from Austria

          8
          NewbieNewbie
          8

            Re: PHP $_POST replaced by _POST on typing

            Dec 17, 2014#5

            Thank you so much, Mofi.

            Not only your computer knowledge but also your writing is amazing.

            I really appreciate it.