Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-ui-dev] Brace, parenthesis, quotation matching

JDT shows matching braces or parenthesis.  It does so when the cursor is on
either side of a brace or paren.  For example:

<CARET> == the location of the Caret in the editor.
[char] == a character being highlighted by a faint rectangle in the editor.

<CARET>( i + 5 [ )]
----OR----
(<CARET> i + 5 [ )]

In either case, the same paren is highlighted.  However, this means that:
      (<CARET>( i + 5 ) * 4)
is ambiguous.  Is the highlight showing me the parenthesis that matches the
character to the left or right of the Caret?
I find this confusing.  I only want highlighting to be active when I am on
the INSIDE of the brace/paren.

Double-click selection has the same ambiguity problem when pairs are
touching.  For example:
setText("Foo");
setText(<DOUBLE_CLICK>"Foo");  will select: Foo
BUT
setText("Foo"<DOUBLE_CLICK>); will select: "Foo", this time with quotes.

In both cases, I selected between the parenthesis and the quotation, but
different text was selected.  Ambiguous cases can be removed by only
matching when on the inside of paired delimiters.

My Request:
1) Only show highlight when I am on the "inside" of a deliminter such as {
or (.
2) Intelligent double-click should only work when I am on the "inside"
also.
3) Don't show me the highlight at all when it is less than N characters
away from the Caret, where I can define N in preferences, and N's default
is about 10-20 characters.

This request is in Bug 9503.

One last thing:

setText(<ALT+RIGHT_ARROW>"Some text");  will cause "Some text" to be
selected (quotes included).
      But
setText("Some text"<ALT+LEFT_ARROW>); will cause the entire method to be
selected.
I realize this is correct, but it isn't what the user wants.  When ALT+LEFT
is pressed and the current selection length is Zero, perhaps the index
could be adjusted 1 character to the left to acheive the desired effect.



Back to the top