kamalchopra / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Matching bracket to be dropped if the user types the same bracket #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Type in a parameterless method name e.g. thisclass.open();
2.
3.

What is the expected output? What do you see instead?

As I type I expect to see (); however I end up with ();) due to the 
additional parenthesis.

What version of the product are you using? On what operating system?

JSyntaxPane-080623a.jar  windows

Please provide any additional information below.

This was addressed in Eclipse at one point.  If the user opens a 
parentheses and you add one, any parenthese typed next to the one you 
added should replace, not add an additional one.  Of course the logic is 
probably tougher than that. 

Original issue reported on code.google.com by caulton...@gmail.com on 1 Jul 2008 at 6:50

GoogleCodeExporter commented 9 years ago
Thanks for the report.  
I knew this would probably cause some concerns to some people if the typing 
style is
different than mine.  I usually type the opening bracket and start typing what 
should
be between them, and skip closing the bracket. 
I think it is more complicated to implement the Eclipse style, and beyond the
features I can support now.
You can disable that altogether.  In the {{{SyntaxKit.install}}} method, just 
delete
or comment out the actions automatically added for Java / Groovy and others:

{{{
        if ("groovy".equals(lang) || "java".equals(lang)) {
            SyntaxActions.addAction(editorPane, '(', SyntaxActions.LPARAN);
            SyntaxActions.addAction(editorPane, '[', SyntaxActions.LSQUARE);
            SyntaxActions.addAction(editorPane, '"', SyntaxActions.DQUOTE);
            SyntaxActions.addAction(editorPane, '\'', SyntaxActions.SQUOTE);
            SyntaxActions.addAction(editorPane, "ENTER", SyntaxActions.JAVA_INDENT);
        } else if (lang.equalsIgnoreCase("xml")) {
            SyntaxActions.addAction(editorPane, "ENTER", SyntaxActions.SMART_INDENT);
        }
}}}

Original comment by ayman.al...@gmail.com on 2 Jul 2008 at 6:02

GoogleCodeExporter commented 9 years ago
Also, please make sure to get the latest version.  You are using 080623a, and 
the
latest is 080701a.
Ayman

Original comment by ayman.al...@gmail.com on 2 Jul 2008 at 6:12