This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 178006 - Single and Double Quote invalid cursor placement
Summary: Single and Double Quote invalid cursor placement
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal with 1 vote (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-02 10:27 UTC by nickashley
Modified: 2011-06-08 09:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nickashley 2009-12-02 10:27:04 UTC
I have installed the 6.8RC version of Netbeans, with PHP support. While working in a file, every time I type a single quote, the editor will effectively move the cursor one character to the right (if it is at the end of the line, the cursor will jump to the beginning of the next line) before entering the single quote. 

Also, when I enter a double quote, the editor will effectively enter a 'delete' (not backspace) keystroke before the double quote.

As far as I know I have no funky language settings or anything like that enabled on my computer. I never work in other languages, and use a standard English keyboard.
Comment 1 nickashley 2009-12-03 09:44:12 UTC
So I take it the deletion means the bug will not be fixed? I don't know what other information I can give, but this is the one thing stopping me from using Netbeans over Notepad++
Comment 2 Filip Zamboj 2009-12-03 14:14:52 UTC
there is deletion. You are probably referring to same parameters were removed. The history says it was submitted to wrong component and now it's in php. We will have a look on this.
Comment 3 Filip Zamboj 2009-12-03 14:15:26 UTC
correction: there is no deletion.
Comment 4 nickashley 2009-12-03 18:14:30 UTC
Thanks, when it moved to the proper component, I though it had been deleted. 

This bug happens on a fresh install of both 6.7 and 6.8RC1. Let me know if there is any more information I can provide.
Comment 5 nickashley 2009-12-05 11:29:14 UTC
Some more information:

If I record a macro and then type a single quote, the macro code registers the following:  caret-forward "'"

When I record a double quote, the macro code registers: selection-forward "\""

However when typing in an input box outside of the editor, for example when naming the macro, or typing in a dialog from tools > options the quotes behave correctly. 

I currently have "insert closing brackets automatically" disabled, although I experienced the same general problem with this feature enabled as well.
Comment 6 arun_reginald 2009-12-08 04:55:42 UTC
This is happening on the version of Netbeans that I am using. It apparently also happens when I type the 'AT(@)' character. I am working on 6.8 Beta (Build 200910212001) now, but this also happened on the 6.7 I installed. I am using Windows Vista Home Premium.

I reckon, it must have something to do with the Java Platform I am using. I am using 1.7.0-ea; Java HotSpot(TM) Client VM 16.0-b08.

This never happened when I used the JDK/JRE version 1.6.
Comment 7 Filip Zamboj 2009-12-08 05:00:12 UTC
this is not P1. 

http://wiki.netbeans.org/BugPriorityGuidelines => P3
Comment 8 Filip Zamboj 2009-12-08 05:35:58 UTC
I think you guys are referring to more different issues here. Please correct me if I didn't get something right. 

1. nickashley@netbeans.org: doubl quote and single quote auto-completion. 

I am not sure what's exactly a problem here. 
1.a. If you type ' you will get '|' where | stands for carret. 
1.b. If you type " you will get "|". 
1.c if you have '|' and add " you get '"' and that's still correct, isn't it? I need an example where it's wrong to make something about it.  

2. nickashley@netbeans.org: if it is at the end of the line, the cursor will jump to the beginning of the next line. 

A problem? 


3. nickashley@netbeans.org: Also, when I enter a double quote, the editor will effectively enter a 'delete'(not backspace) keystroke before the double quote. 

what do you mean by this? 


4. macros belong to component editor not php. File this problem against editor then. We can't help you with that.
Comment 9 nickashley 2009-12-08 10:08:17 UTC
1.a. If you type ' you will get '|' where | stands for carret. 
- NO: the cursor will move to the right, then add a single quote. For example, if I currently have nick|s (where | is the cursor) and I type a single quote, I will get nicks'. I have disabled the quote matching, so it only types one quote, not 2.

1.b. If you type " you will get "|". 
- NO: Again, if I have nick|s and type a double quote, i get nick". 

1.c if you have '|' and add " you get '"' and that's still correct, isn't it? I
need an example where it's wrong to make something about it.  
- NO: I would get '" in this case

2. nickashley@netbeans.org: if it is at the end of the line, the cursor will
jump to the beginning of the next line. 

A problem? 
- A BIG problem. If I type a single quote at the end of the line, I want it to append a single quote to the end of that same line. Instead, it adds a single quote to the beginning of the next line.

3. nickashley@netbeans.org: Also, when I enter a double quote, the editor will
effectively enter a 'delete'(not backspace) keystroke before the double quote. 

what do you mean by this? 
- Look at my answer to 1c. It removes the charactor after the cursor before inserting the double quote. (and no, my keyboard is not setup to overwrite characters)

4. macros belong to component editor not php. File this problem against editor
then. We can't help you with that.
- There is not a problem with the macros, I simply added this information to demonstrate that by entering a single or double quote, Netbeans is adding extra incorrect keystrokes. Because macros record every keystroke Netbeans receives, it makes it very easy to see the error. However, the macros themselves are working perfectly.
Comment 10 nickashley 2009-12-08 10:13:30 UTC
arun_reginald, thank you! You have correctly identified the problem it looks like! I reinstalled Netbeans, and during the installation process it shows what version of the JDK is going to be used. Version 1.7.0 was selected by default, but it was a dropdown and version 1.6 was also available. I selected version 1.6, and that fixed all my problems!
Comment 11 Filip Zamboj 2009-12-08 12:51:07 UTC
okey, now i see and it makes sense. Will have a look on this.
Comment 12 Filip Zamboj 2009-12-09 07:55:25 UTC
Product Version: NetBeans IDE Dev (Build 091207-11903a3229df)

using jdk 1.6, the same with 1.7.0 
1.a 
$var = "nicks|" 
add ' between k & s 
$var = "nick'|s" 

1.b works as well. 

2.a 
@rmatous: could you help me where is the end of the line - it is definitely not easy to reach so easily ... ? Is there any option to set this? 

3. I can't reproduce 1 and 2 so I can't reproduce this one as well. 

@reporters: 
please, note that 1.7.0-ea is early access version and supported by platform.
Please, try to reproduce your problem on 6.8RC2 or FCS(coming very soon) - I didn't make it on new NB version. 
Please evaluate my steps above if they are correct.
Thanks.
Comment 13 Filip Zamboj 2009-12-09 07:56:58 UTC
correction: 1.7.0 is NOT supported yet.
Comment 14 arun_reginald 2009-12-10 11:30:16 UTC
As I mentioned earlier, this problem only occurs on NetBeans (versions 6.7 onwards) if the underlying Java platform is 1.7.0 (JDK7) - early access release (nightly builds) or not.

This problem is resolved if you downgrade to the latest supported version of the JDK on the Sun's website. I tried reproducing the bug with:

- Product Version: NetBeans IDE 6.8 RC2 (Build 200912022200)
- Java: 1.6.0_17; Java HotSpot(TM) Client VM 14.3-b01

..and everything seems to work fine now. It just goes to show that a lot of work might be needed to fix this issue when JDK7 is around.
Comment 15 Filip Zamboj 2010-09-15 12:30:31 UTC
batch reassigning
Comment 16 Petr Pisl 2011-04-12 14:43:06 UTC
I can not reproduce in NB 7.0. I think this is already fixed. Please feel free to reopen if it still doesn't work for you.
Comment 17 Vladimir Riha 2011-06-08 09:58:09 UTC
Verified...

Product Version: NetBeans IDE 7.0.1 Dev (Build 201106072116)
Java: 1.7.0-ea; Java HotSpot(TM) Client VM 21.0-b15