Problem with automatically changing case!

Problem with automatically changing case!

4
NewbieNewbie
4

    Jul 18, 2005#1

    Hi all,

    I'm currently evaluating UltraEdit-32 as I would like my company to buy it for me so that I can switch from Textpad, which I have used up until now.

    I have just a few issues that I would like to sort out before buying this, otherwise excellent program.

    The main one is that, when typing a certain regular expression for perl, UltraEdit-32 automatically changes the case of a character! This is very annoying indeed!

    This is what I type:

    Code: Select all

    if ($line =~ /\Q<!-- WiPS v1.01 BBC Wales New Media -->\E/g);
    and I end up with:

    Code: Select all

    if ($line =~ /\q<!-- WiPS v1.01 BBC Wales New Media -->\E/g);
    As you can see, the regular expression will now break as the capital 'Q' has been changed to a lower-case 'q'.

    The other problem that I am having is to do with the auto-indenting behavior.
    I like auto indenting, but UltraEdit's is too prescriptive.
    I like the behavior whereby when you already have an indent and press return the cursor auto-indents to your currnt indent column - for instance, if I have a foreach loop I like to format it like this:

    Code: Select all

    foreach my $line (@data) {
            &do_this;
            }
    
    If I press return after the semicolon of '&do_this;' I like the cursor to appear directly under the '&'. This currently happens which is great. Unfortunatly there is other auto-indent functionality that I would like to turn off.

    When I'm editing a perl file and I type something like:

    Code: Select all

    sub a_routine {
    ...the next line is auto-indented to the number of spaces (or tabs) set up in the edit tab of the Configuration menu. I would like to set this to '0', as I don't indent my code in this way. I like my indents to follow the structure of the code.

    Weirdly, if I just hit the 'new file' button this behavior is not present.
    It is only when I'm editing HTML or Perl files that this happens :?

    Any help on either of these issues would be greatly appreciated :)

    Many thanks in advance.

    6,683583
    Grand MasterGrand Master
    6,683583

      Jul 18, 2005#2

      Auto Indent can be turned off at Edit configuration page.
      Auto Correct Keywords can be turned off at Syntax Highlighting configuration page.

      Both functions are controlled by the syntax highlighting definition file - default Wordfile.txt in UltraEdit program directory. That's the reason why it works different, if you edit a new file, which is not already saved with an extension defined in the wordfile.

      Instead of turning off auto correction, you can either add the keyword Nocase to the "Perl" language definition line or you add Q to a color group or you remove \ from the list of delimiter characters. This will work for your example. Hope you understand why and you can now define it according to your needs.

      To get auto indent like you want, a little trick must be used. Edit the following two lines at the "Perl" section in your wordfile from
      /Indent Strings = "{"
      /Unindent Strings = "}"

      to
      /Indent Strings = "IDENTON"
      /Unindent Strings = "IDENTOFF"


      As long as you do no type IDENTON or IDENTOFF in your perl scripts, it solves your problem.

      For all UE users: If auto indent on specific strings is not wanted, define an indent and unindent string, which never occur in the highlighted file.
      Best regards from an UC/UE/UES for Windows user from Austria

      4
      NewbieNewbie
      4

        Jul 18, 2005#3

        Many thanks Mofi :)

        I've turned off 'Auto Correct Keywords' and made the change you suggested to the wordfile.txt

        For anybody else making this change I would point out that there are several declarations of /Indent Strings and /Unindent Strings to search for in wordfile.txt

        Once I found them all and made the suggested change I got the functionality I desired.

        Many thanks again :)