Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: rickg22 on May 09, 2005, 07:35:01 pm

Title: Brace matching in the editors?
Post by: rickg22 on May 09, 2005, 07:35:01 pm
I stumbled upon a feature request, and I don't know how to handle it. It says that whenever you close a brace, the matching brace should be highlighted.

Currently this only happens if i move the cursor. For example:

something(){ blablah }  (here the matching brace is highlighted).

But:

something(){ blablah }_   (nothing happens)

Any idea on how to solve this riddle? Do we have to modify the scintilla source code, or derive the wxStyledTextEditor? Or it can't be done at all?

Anyone?  :?: [/u]
Title: Brace matching in the editors?
Post by: mandrav on May 09, 2005, 10:14:20 pm
OMG, Rick if you could just look at the code...
Hint: look at cbEditor::HighlightBraces()

Yiannis.
Title: Brace matching in the editors?
Post by: rickg22 on May 09, 2005, 10:47:04 pm
Oops :oops: ok thanks... I think I'll have to study the full editor source code. :oops: :oops:

I'll search on the web for it. Thanks.
Title: Brace matching in the editors?
Post by: mandrav on May 09, 2005, 11:41:18 pm
Quote
I'll search on the web for it. Thanks.

 :?:  :?:  :?:  :?:
Search what? It's in the function I told you...

Yiannis.
Title: Brace matching in the editors?
Post by: rickg22 on May 09, 2005, 11:49:24 pm
Oh, fool me... i thought you were talking about StyledTextCtrl. Anyway I submitted the patch now. It's on SF (i'm at work). What confused me was that i couldn't find a HighlightBraces call anywhere.
(Note to self: Don't try to program CB at work :roll: - I guess that explains this odd behavior, huh? :oops: )
Title: Brace matching in the editors?
Post by: David Perfors on May 10, 2005, 07:34:40 am
Quote from: rickg22
Oh, fool me... i thought you were talking about StyledTextCtrl. Anyway I submitted the patch now. It's on SF (i'm at work). What confused me was that i couldn't find a HighlightBraces call anywhere.
(Note to self: Don't try to program CB at work :roll: - I guess that explains this odd behavior, huh? :oops: )

This also could happen when you are home ;)  so don't worry  :lol:
Title: Brace matching in the editors?
Post by: rickg22 on May 10, 2005, 06:37:54 pm
In any case i submitted the patch. :) Thanks for the support!