SlickEdit Community

Archived Read Only Forums => SlickEdit 2016 v21 Beta Discussion => Topic started by: jporkkahtc on August 17, 2016, 11:56:56 pm

Title: Brace Matching with < and >
Post by: jporkkahtc on August 17, 2016, 11:56:56 pm
Place cursor between "<" and "T2" in "foo" line
Ctrl+]  (find-matching-paren)
Cursor goes to matching ">"
Ctrl+]  (find-matching-paren)
Cursor goes to "(" after MACRO.

Do the same with "bar", where () replace <>, and it works correctly.
Or, add spaces around the ">" and it works correctly.


void foo(thing<T2, sizeof(T2), MACRO(T2)>) {}
void bar(thing(T2, sizeof(T2), MACRO(T2))) {}
Title: Re: Brace Matching with < and >
Post by: Clark on August 18, 2016, 01:35:50 am
We will look into this
Title: Re: Brace Matching with < and >
Post by: Clark on August 18, 2016, 01:46:27 am
Change def_pmatch_chars to "()[]{}<>". That will do what you want. It does effect all languages. That doesn't really matter in this case because the special C++ code isn't doing anything really smart. The code has no idea that this is a template class argument.

Not sure if we will change the default here.
Title: Re: Brace Matching with < and >
Post by: Tim Kemp on August 18, 2016, 11:59:26 am
If you make this the default it will have an interesting effect on logical statements. I don't think you want that. For example:

Code: [Select]
if ((a<b) && (c>d)) {}
The highlighting of the matching character (> or <) is rather confusing.
Title: Re: Brace Matching with < and >
Post by: Clark on August 18, 2016, 01:17:40 pm
The default code has a more conservative algorithm for handling <> highlighting. I'm sure it's not perfect but it doesn't goof on that example.
Title: Re: Brace Matching with < and >
Post by: Tim Kemp on August 18, 2016, 01:27:19 pm
It does on my computer.
(http://imgur.com/vqP6P1o.png)
Title: Re: Brace Matching with < and >
Post by: Clark on August 18, 2016, 04:18:19 pm
It does on my computer.
(http://imgur.com/vqP6P1o.png)

Are you def_pmatch_chars set to the default "()[]{}"?
Title: Re: Brace Matching with < and >
Post by: Tim Kemp on August 18, 2016, 05:10:36 pm
No, "()[]{}<>", as you suggested to jporkkahtc. You'd mentioned maybe changing the default to this. I tried it to see if it would cause any weirdness. It did.
Title: Re: Brace Matching with < and >
Post by: Dennis on August 24, 2016, 04:57:46 pm
I am putting in a tweak to make this work more as expected for beta4.