Announcement

Collapse
No announcement yet.

Ctrl Y. Ctrl Z hickup in IDE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ctrl Y. Ctrl Z hickup in IDE

    This is a problem which I have experienced basically since Win 98 and PB/CC 3x.
    Currently I have it on PB/CC 5.01 and PB/Win 9.01 under Win XP SP2:

    A Ctrl Y cuts a line of text and Ctrl Z should redo that action, right?
    But this line then ends up one line below the last selection/highlight.
    As long as there has not been any selection of text yet, it ends up as the first line of the file.

    A simple test goes like this:
    - start a new file in IDE with File | New File
    - go to the last line (END FUNCTION)
    - cut it with Ctrl Y
    - redo with Ctrl Z.
    Now END FUNCTION is the first line on the screen.

    As long as that was the only change, one is not prompted for changes in the file when trying to save it.

    PB support has been helpful, but cannot replicate this behavior.
    One obvious difference is that the hardware I use has a German keyboard (Y and Z interchanged!).
    That said, it does not make any difference, if I use the German or English keyboard mapping option.
    One could also suspect a virus checker. Well I use McAffe 8.7.0i. Deactivating the access checks
    doesn't make any difference, though.

    Has anyone else ever experienced this problem? Maybe other users of German keyboards could test it ...
    and maybe users of McAffe?

    Best regards,
    Gert Voland.
    Gert Voland

  • #2
    Originally posted by Gert Voland View Post

    A simple test goes like this:
    - start a new file in IDE with File | New File
    - go to the last line (END FUNCTION)
    - cut it with Ctrl Y
    - redo with Ctrl Z.
    Now END FUNCTION is the first line on the screen.

    Best regards,
    Gert Voland.
    Yes, occurs here too. PB 9.01

    Start a new file in the IDE
    Position the cursor using the KEYBOARD NOT the MOUSE to END FUNCTION

    Ctrl Y
    Ctrl Z

    Note that the line is added to the top of the file.

    Seems once the MOUSE is clicked in the file the strangeness goes away. Work around might be to, before editing a file, click the mouse in the window somewhere.

    Comment


    • #3
      Brian,
      Position the cursor using the KEYBOARD NOT the MOUSE to END FUNCTION
      Yes, when you use the mouse, the line gets highlighted and the subsequent insertion happens below the last selection - which seems to be OK in that case .

      May be we can pin it down even further ...

      Rgds,
      Gert.
      Gert Voland

      Comment


      • #4
        I must be misunderstanding something here.
        Code:
        Function PBMain As Long
        End Function
        Ctl-Y on "End Function" deletes the )last) line as expected. The cursor immediately goes to the beginning of the new last line "Function PBMain" and Ctl-V inserts it as expected at the beginning of the line. What am I missing? That doesn't seem wrong to me. Having a blank line either before or after "End Function" and Ctl-V puts the deleted line there.

        ================================
        "Not a shred of evidence exists
        in favor of the idea
        that life is serious."
        Brenda Grill
        ================================
        It's a pretty day. I hope you enjoy it.

        Gösta

        JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
        LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

        Comment


        • #5
          Originally posted by Gösta H. Lovgren-2 View Post
          I must be misunderstanding something here.
          Code:
          Function PBMain As Long
          End Function
          Ctl-Y on "End Function" deletes the )last) line as expected. The cursor immediately goes to the beginning of the new last line "Function PBMain" and Ctl-V inserts it as expected at the beginning of the line. What am I missing? That doesn't seem wrong to me. Having a blank line either before or after "End Function" and Ctl-V puts the deleted line there.

          Ctrl-Z UNDO not CTRL-V (paste)

          Undo should put the cut text back where it was.

          Comment


          • #6
            I checked the behavior again and found the following systematic and reproducible problem:


            - Open any file in IDE
            - Set the cursor to any line using the mouse or select a few characters in a line
            - Move the cursor to another line using the keyboard
            - Cut that line by Ctrl Y
            - Undo the operation by Ctrl Z
            - Then the cut line gets inserted
            above the last line that had the cursor set by the mouse or
            below the last line that had a selection/highlight (by mouse or keyboard)
            - If the mouse cursor or selection were on the cut line, one does not notice
            the effect: it just seems to be OK.


            Are Brian and I really the only ones that experience this problem?
            Since PB support could not reproduce it, I wonder what distinguishes us -
            virus checker, keyboard, ... ?

            Rgds,
            Gert
            Gert Voland

            Comment


            • #7
              Same problem here - CC 5.01 & PB 9.01 / XP SP3 pt-br
              "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

              Comment


              • #8
                Originally posted by Brian Chirgwin View Post
                Ctrl-Z UNDO not CTRL-V (paste)

                Undo should put the cut text back where it was.
                Ahhh, The Olde Ctl-Z trick. My bad. I seldom use Ctl-Z. Just don't think of it I guess.

                It seems to work as advertised here. 'PBWIN 9.01 - WinApi 05/2008 - XP Pro SP3


                ===================================================
                "There are a billion people in China.
                It's not easy to be an individual
                in a crowd of more than a billion people.
                Think of it.
                More than a BILLION people.
                That means even if you're a
                one-in-a-million type of guy,
                there are still a thousand guys exactly like you."
                A. Whitney Brown
                ===================================================
                It's a pretty day. I hope you enjoy it.

                Gösta

                JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                Comment


                • #9
                  Update on the steps to reproduce

                  1. open a new file in the IDE

                  2. Use the down arrow on your keyboard to get to a line with text. Do not use shift, control or any other keys. Just the down arrow.

                  3. Type Ctrl-Y (delete line) the line the cursor is on will be deleted. Do not highlight any of the text. Using Shift arrow left, down or right will highlight text and the issue will not appear.

                  4 Type Ctrl-Z (undo). The line will be restore the line at the top of the file. You can repeat Ctrl-Y/Ctrl-Z and it will keep replacing lines at the top of the file.

                  5. Now highlight a line of text (or a few characters). Ctrl-Y/Ctrl-Z and the line is where it was.

                  The new idea here is once text is highlighted the issue does not appear.

                  Another test

                  Paste in the following into a pb window

                  Code:
                  #Compile Exe
                  #Dim All
                  
                  Function PBMain () As Long
                  
                      111111
                      222222
                      333333
                      444444
                      555555
                  
                  End Function
                  1. open a new project window
                  2. Using the keyboard move the cursor to the blank line
                  3. Using the keyboard move the cursor to the line with the 2's
                  4. Hold shift and right arrow highlighting only one character (NOT down arrow as this will highlight an entire line putting the cursor at the following line)
                  5. Now move the cursor down arrow to the lines with the 5's (don't use the shift key)
                  6. Ctrl-Y (do not highlight any text)
                  7. Ctrl-Z

                  The 5's will be placed right after the 1's as follows:

                  Code:
                  #Compile Exe
                  #Dim All
                  
                  Function PBMain () As Long
                  
                      111111
                      555555
                      222222
                      333333
                      444444
                  
                  End Function
                  Can anybody else reproduce this now? Do we have the steps to reproduce this correct?

                  Comment


                  • #10
                    This is reproducable in PBEdit supplied with both PBWin804 and PBWin901..
                    Code:
                    1 Type or copy these lines into the editor.
                    2 Click the mouse anywhere on this line.
                    3
                    4
                    5
                    6 Down arrow to this line, press Ctrl-y.
                    7 Press Ctrl-z.
                    .. Where's the "restored" line now? (Between lines 1 and 2)
                    .
                    .
                    Do it again but this time use the shift key and the right arrow key to highlight a
                    single character on line 2.2 THEN use the down arrow again to go to line 6.6,
                    again Ctrl-y, Ctrl-z - now "undone" result is between 1 & 2
                    .
                    .
                    1.1
                    2.2 Click the mouse somewhere on this line, then shift-right arrow to highlight one character..
                    3.3
                    4.4
                    5.5
                    6.6 Down arrow to this line, press Ctrl-y.
                    7.7 Press Ctrl-z.
                    ..   Where's the "restored" line now? (Between lines 2.2 & 3.3)
                    (I typed all the above text and saved it to a file, then made it read only so I could reload / repeat many times).
                    Rgds, Dave

                    Comment


                    • #11
                      Dave,

                      that is exactly what I see too. We have it in Australia, Brazil, US and Germany.

                      So far there is no common item, such as keyboard, anti-virus checker or country setting, that would give us a clue.

                      Who else sees this effect? Are we the only 4?

                      Rgds,
                      Gert.
                      Gert Voland

                      Comment


                      • #12
                        The conditions are not so complex as your steps would indicate:

                        I copied your test program from the forum to my clipboard, then opened a new file and got the default template's text. I did CTRL-A to select all, and deleted it.

                        Then I pasted in your program and used the up arrow to get to the 222222 line.

                        CTRL-Y cut the line, and CTRL-Z pasted it to the top line.

                        -jhm

                        Added:
                        After this, I used the mouse and couldn't get the immediate CTRL-Y, CTRL-Z to do the odd behavior.
                        But I repeated my CTRL-A, DELETE, then went and got the program again and copied it into the IDE.
                        The odd behavior was once again operating...
                        Last edited by John Montenigro; 3 Aug 2009, 12:22 PM. Reason: more info

                        Comment


                        • #13
                          Originally posted by Dave Biggs View Post
                          This is reproducable in PBEdit supplied with both PBWin804 and PBWin901..

                          1 Type or copy these lines into the editor.
                          2 Click the mouse anywhere on this line.
                          3
                          4
                          5
                          6 Down arrow to this line, press Ctrl-y.
                          7 Press Ctrl-z.
                          .. Where's the "restored" line now? (Between lines 1 and 2)
                          On my setup, JellyFishPro - PBWin 9.?, XP2.?
                          it's restored to line 6.

                          .
                          .
                          Do it again but this time use the shift key and the right arrow key to highlight a
                          single character on line 2.2 THEN use the down arrow again to go to line 6.6,
                          again Ctrl-y, Ctrl-z - now "undone" result is between 1 & 2
                          .
                          .
                          1.1
                          2.2 Click the mouse somewhere on this line, then shift-right arrow to highlight one character..
                          3.3
                          4.4
                          5.5
                          6.6 Down arrow to this line, press Ctrl-y.
                          7.7 Press Ctrl-z.
                          .. Where's the "restored" line now? (Between lines 2.2 & 3.3)
                          On my setup, 6.6

                          (I typed all the above text and saved it to a file, then made it read only so I could reload / repeat many times).
                          Ditto.

                          I would suggest, if the above behavior is annoying to you, that you download JFP (it's free) and try that.

                          Later - Just tried the same thing with the PBWin IDE (9.00.?) and the weird behavior happened in the IDE. Solution - Switch to JFP.

                          =========================================
                          First keep the peace within yourself,
                          then you can also bring peace to others.
                          Thomas a Kempis
                          =========================================
                          It's a pretty day. I hope you enjoy it.

                          Gösta

                          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                          Comment


                          • #14
                            ..Solution - Switch to JFP.
                            Actually I don't have a problem with that behaviour anyway as I normally use EditPlus (http://www.editplus.com/ ) and in that editor Ctrl-Y is 'ReDo'. On the occasions I do use PBEdit I don't use the Ctrl-y : cut line to clipboard function anyway (my habit is to highlight then press Ctrl-x).

                            Point is - this is an 'unintended feature' of PBEdit
                            Rgds, Dave

                            Comment


                            • #15
                              More PBEdit problems

                              I have just checked the other "Editor Hot Keys" as described in Help of PB/CC5.01 and PB/Win 9.01.

                              The undo problem occurs also with other keys:
                              - Not only with Ctrl+Y (Cut line) but also with Ctrl+K or F6 (Clear to end of line).
                              - The problematic undo can be done with either Ctrl+Z, Alt Backspace or Menu: Edit | Undo.
                              Ctrl+T (Delete a word) is not affected.


                              And this is another unexpected behavior:

                              - Use keyboard to move to a different line from last mouse caret or selection
                              - Duplicate with F4
                              - Cut the line at caret (lower one)
                              - Undo with Ctrl+Z => Line ends up next to last mouse caret or selection
                              - Undo again (the previously duplicated line) => Line gets deleted!!
                              (Do we know what two Undo's should do? As far as I know there is no Redo ...)

                              Also:
                              Ctrl+U does not work as described.
                              Ctrl+H deletes the character to the left but is not described.

                              Point is - this is an 'unintended feature' of PBEdit
                              Yes, I agree, we should help PB to correct this. I just don't see why some
                              users seem to be affected, others not. In any case, I will keep reporting ..

                              Best wishes,
                              Gert Voland.
                              Gert Voland

                              Comment


                              • #16
                                Old way

                                I always use Ctrl-Insert and Shift-Insert to move text around and it works all the time.
                                Ctrl-Y to delete a whole line and Shift-Insert to write it where you want.
                                Shift-Arrow or Shift-End to hi-light part of a line or use mouse to hi-light any part of text. Just hit Delete to erase it and Shift-Insert to re-write it.
                                Of course, that trick also work with the mouse.
                                Old QB45 Programmer

                                Comment


                                • #17
                                  Guy,

                                  Yes, all the other features of PBEdit work as announced.

                                  On a German keyboard the Ctrl+Y can be done with the left hand easily because Y and Z are
                                  interchanged - i.e. the lowest row has the keys: < Y X C V B ... Thus, the Y is very close to the left Ctrl key.

                                  Have you tried the Ctrl+Y and Ctrl+Z sequence after moving the caret only with keys (up/down/Ctrl End etc.)?
                                  Do you get this unexpected insertion?

                                  Rgds,
                                  Gert.
                                  Gert Voland

                                  Comment


                                  • #18
                                    It happens to me too with PBEdit from PBWin v9.01 under Windows XP SP3.

                                    I would say it is most likely caused by the PBEdit code not updating positions when certain navigation options are used (ie. arrow keys, et al), not keeping track of the position of where something was changed or using the wrong variable for positioning the data that is being undone.
                                    Jeff Blakeney

                                    Comment


                                    • #19
                                      Have you tried the Ctrl+Y and Ctrl+Z sequence after moving the caret only with keys (up/down/Ctrl End etc.)?
                                      Do you get this unexpected insertion?
                                      Gert,

                                      It is working like it should.
                                      I use a US keyboard with codepage 437 instead of a French keyboard.
                                      This an old Olivetti unit with a nice feel that you can't find with the new ones.
                                      But I have to use the ALT key for my accents.
                                      Old QB45 Programmer

                                      Comment

                                      Working...
                                      X