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.
Summary: | [50cat] Why editor always Duplicate " mark ? it should not duplicate it in some cases | ||
---|---|---|---|
Product: | editor | Reporter: | kalali <kalali> |
Component: | -- Other -- | Assignee: | issues@editor <issues> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
kalali
2005-10-29 21:06:45 UTC
This is IMO a P2 candidate. I agree. This is very annoying if you write multiline string - e.g. you want to copy them from another application. Try to convert: pasted line 1 pasted line 2 pasted line 3 into: String s = "pasted line 1" + "pasted line 2" + "pasted line 3"; Each time duplicate quotes are typed in. *** Issue 68181 has been marked as a duplicate of this issue. *** *** Issue 50006 has been marked as a duplicate of this issue. *** Right now the extra quote insertion algorithm is in BracketCompletion.completeQuote() which is triggered after inserting of the initial quote char. It was written by Ondra R. originally and although I mostly understand it it's IMHO too late to check the situation AFTER the insertion of the first quote as the lexical information is already garbled by the first quote insertion. Ideally the situation should be checked BEFORE inserting the first quote. The conditions when the extra quote should be added should IMHO be the following: 1) When at EOL - i.e. there will not be unclosed string at EOL 2) When lexically before ')' or '+' or ',' or ';' or '}' (ignoring the whitespace) Although this may differ from the present behavior it should be more consistent. If acceptable we will start to implement this. Roman's example could be a refactoring too :-) fixed in [maintrunk] Checking in src/org/netbeans/modules/editor/java/BracketCompletion.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/BracketCompletion.java,v <-- BracketCompletion.java new revision: 1.9; previous revision: 1.8 done Checking in src/org/netbeans/modules/editor/java/JavaKit.java; /cvs/java/editor/src/org/netbeans/modules/editor/java/JavaKit.java,v <-- JavaKit.java new revision: 1.25; previous revision: 1.24 done Checking in test/unit/src/org/netbeans/modules/editor/java/JavaBracketCompletionUnitTest.java; /cvs/java/editor/test/unit/src/org/netbeans/modules/editor/java/JavaBracketCompletionUnitTest.java,v <-- JavaBracketCompletionUnitTest.java new revision: 1.2; previous revision: 1.1 done Checking in test/unit/src/org/netbeans/modules/editor/java/JavaFormatterUnitTest.java; /cvs/java/editor/test/unit/src/org/netbeans/modules/editor/java/JavaFormatterUnitTest.java,v <-- JavaFormatterUnitTest.java new revision: 1.6; previous revision: 1.5 done works fine now in rc1 |