Author Topic: Brace matching in the editors?  (Read 9349 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Brace matching in the editors?
« 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]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Brace matching in the editors?
« Reply #1 on: May 09, 2005, 10:14:20 pm »
OMG, Rick if you could just look at the code...
Hint: look at cbEditor::HighlightBraces()

Yiannis.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Brace matching in the editors?
« Reply #2 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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Brace matching in the editors?
« Reply #3 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.
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Brace matching in the editors?
« Reply #4 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: )

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Brace matching in the editors?
« Reply #5 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:
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Brace matching in the editors?
« Reply #6 on: May 10, 2005, 06:37:54 pm »
In any case i submitted the patch. :) Thanks for the support!