[ phpeclipse-Bugs-1380415 ] When I try to delete text the wrong text is deleted.

"SourceForge.net" <[email protected]> Sat, 24 Mar 2007 02:38:54 -0700
Newsgroups gmane.comp.ide.eclipse.phpeclipse.devel
Message-ID <[email protected]>
Bugs item #1380415, was opened at 2005-12-14 22:02
Message generated for change (Comment added) made by toshihiro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1380415&group_id=57621

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: PHP Editor
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: When I try to delete text the wrong text is deleted.

Initial Comment:
Hi, I'm Danilo, my email is [email protected]

I'm using the latest CVS snapshot from
http://sourceforge.net/project/showfiles.php?group_id=57621&package_id=165724

I did the following:


call a method from an object
   $obj->callSomeMethod;

Notice I forgot to put the (), this is proposital.
I then hit enter and write some coment.

   $obj->callSomeMethod;
   /*
    * Some coment
    *
    */

Then I go back to the method call and put the ().
   $obj->callSomeMethod();
   /*
    * Some coment
    *
    */

Finally I hit Down Arrow and try to delete the "*" from
the comment. Then this weird thing happens. The cursor
is near the the first "*" from the comment, but what
got deleted was the "()" from the method call.

A friend of mine noticed the same behavior in version
1.0.7.

Thanks

----------------------------------------------------------------------

Comment By: Toshihiro (toshihiro)
Date: 2007-03-24 18:38

Message:
Logged In: YES 
user_id=1527096
Originator: NO

Here is *my* modification against
net.sourceforge.phpeclipse_1.1.9.CVS-20060920.

net.sourceforge.phpeclipse.phpeditor
PHPUnitEditor.java

  private static class ExitPolicy implements LinkedPositionUI.ExitPolicy
{

(snip)

    public ExitFlags doExit(LinkedPositionManager manager, VerifyEvent
event, int offset, int length) {
      if (event.character == fExitCharacter) {
        if (manager.anyPositionIncludes(offset, length))
          return new ExitFlags(LinkedPositionUI.COMMIT |
LinkedPositionUI.UPDATE_CARET, false);
        else
          return new ExitFlags(LinkedPositionUI.COMMIT, true);
      }
      //XXX:begin
      switch (event.keyCode) {
      case SWT.ARROW_UP:
      case SWT.ARROW_DOWN:
        return new ExitFlags(LinkedPositionUI.COMMIT, true);
      case SWT.ARROW_LEFT:
      case SWT.ARROW_RIGHT:
        if (!manager.anyPositionIncludes(offset, length))
          return new ExitFlags(LinkedPositionUI.COMMIT, true);
        break;
      }
      //XXX:end
      switch (event.character) {
      case '\b':
        if (manager.getFirstPosition().length == 0)
          return new ExitFlags(0, false);
        else
          return null;
      case '\n':
      case '\r':
        return new ExitFlags(LinkedPositionUI.COMMIT, true);
      default:
        return null;
      }
    }
  }


----------------------------------------------------------------------

Comment By: Mikko Rantalainen (mr3038)
Date: 2006-07-07 18:49

Message:
Logged In: YES 
user_id=810055

I can reproduce this problem with Eclipse 3.2.0, PHP Eclipse
1.1.8 running on Java HotSpot(TM) Client VM (build
1.6.0-rc-b88, mixed mode, sharing) on i686 Mandriva Linux 2005.

Steps to reproduce:

1) put caret at the start of an empty line (PHP mode)
2) Type "$x->x;"
3) Press Enter
4) Type "/*"
5) Press Enter
6) Move caret between the "x" and ";" two lines above
7) Press "(" [whitness ")" appearing automatically]
8) Press down arrow once (caret is after "*" character)
9) Press backspace

Expected: the "*" character should be deleted
Actually happens: characters "()" are deleted on the line above.


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2006-01-12 20:48

Message:
Logged In: NO 

What version of PHPEclipse are you all using?? I'm using the
version listed in my first report. If it was an isolated
case, I would think that its a bug of my machine, but a
friend of mine have the same problem. He is using Window$
and i'm using Ubuntu Linux, so operating system have nothing
to do with it.

Notice that if you copy-paste my bug report to test it will
not work, you have to actualy type it.

If I have an acount here at bugzila, can I post files? If
yes, I'll try to make a video of me doing it, or at least a
series of screenshots.

Thanks

----------------------------------------------------------------------

Comment By: Bananeweizen (bananeweizen)
Date: 2006-01-07 20:06

Message:
Logged In: YES 
user_id=440739

I also can NOT reproduce this bug. I created an empty php
file, added the
<?
?>
lines and then I added your bug report text exactly
following your steps. For me this doesn't trigger the buggy
behavior, neither in current CVS nor in my installed 1.1.7
runtime version.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2006-01-07 04:00

Message:
Logged In: NO 

Here I can always reproduce this behaviour by following the
listed steps. The name of the method doesn't matter, it
doesn't even need to exist, as long as I type
$someVar->someMethod; without the () and hit enter. Are you
following the EXACT same steps as I? For example, if you use
the mouse to position the cursor under the first "*" it
doesn't work, you need to do EXACTLY the same steps in
EXACTLY the same order to reproduce the error.

Thanks.

----------------------------------------------------------------------

Comment By: Robert Kraske (robekras)
Date: 2005-12-16 15:16

Message:
Logged In: YES 
user_id=356703

I tried to reproduce this behavior, but I can't.

Can you always reproduce it?
Do you have special PHPeclipse settings?
Does it occure always (in other files,
other method calls, other classes)?

Does it sometimes work?
When does it work? 
What do you do to make it working?

Thanks


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-12-14 22:06

Message:
Logged In: NO 

Hi all

I forgot to add that I tried to delete the asterisk using
the Backspace key.

Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=484801&aid=1380415&group_id=57621

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV