wrapped line: move cursor to beginning of total line

wrapped line: move cursor to beginning of total line

19
Basic UserBasic User
19

    Dec 20, 2006#1

    I've got a macro that searches for a specific line and deletes everthing above that line:

    Code: Select all

    Find ...
    Key HOME
    SelectToTop
    Delete
    This specific line is very long and wrapped in my window it takes 2 or 3 rows. The problem is, that the "Key HOME" just moves the cursor to column 1 of the 2nd or 3rd row of my line (and not to the beginning of the total line) and then deletes row1 of my specific line too :-(

    How to move the cursor to the absolute beginning of my line or how to use a command to switch word wrap off in that window?

    6,603548
    Grand MasterGrand Master
    6,603548

      Dec 20, 2006#2

      You can use a regular expression to find real start of a line when soft word wrapping is enabled.

      For UltraEdit style - macro contains UnixReOff:

      IfColNum 1
      Key RIGHT ARROW
      EndIf
      Find RegExp Up "%"

      For Unix/Perl style - macro contains UnixReOn or PerlReOn:

      IfColNum 1
      Key RIGHT ARROW
      EndIf
      Find RegExp Up "^"

      The IfColNum code is used here to make sure the cursor is not already at start of a line because this could cause moving the cursor to start of previous line.
      If you are sure you are always not at start of the line after your Find, remove the 3 lines before the regular expression search. Depending on your version of UE/UES IfColNum is also not working correct if something is select - after a Find for example. In this case the cursor is (normally) also never at start of a line and the 3 lines are also not need.
      Best regards from an UC/UE/UES for Windows user from Austria

      19
      Basic UserBasic User
      19

        Dec 20, 2006#3

        Thanks Mofi, it's very simple and it worked! :-)