Author Topic: indentation guilds highlight  (Read 42472 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
indentation guilds highlight
« on: July 20, 2009, 05:02:45 am »
Hello :
     I found that indentation guilds can not highlight in codeblock.So I did a little work for it .
Code
Index: sdk/cbeditor.cpp
===================================================================
--- sdk/cbeditor.cpp (revision 5678)
+++ sdk/cbeditor.cpp (working copy)
@@ -2269,7 +2269,12 @@
         ch == _T('}') || ch == _T(']') || ch == _T(')'))
     {
         if (newPos != wxSCI_INVALID_POSITION)
+           {
                 control->BraceHighlight(currPos, newPos);
+                int currColum = control->GetColumn(currPos);
+                int newColum = control->GetColumn(newPos);
+                control->SetHighlightGuide((currColum < newColum) ? currColum :newColum);
+           }
         else
             control->BraceBadLight(currPos);
     }


[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #1 on: July 20, 2009, 08:55:54 am »
Really Cool!
I would test it in my local copy.
I suggest you can file a "patch" in the berlios page.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline geiermeier

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: indentation guilds highlight
« Reply #2 on: July 20, 2009, 08:59:32 am »
Now that someone mentions it, this is really a missing feature. I've been using my finger on the screen to memorize indentations a lot of times with CB. I hope the colour will be customizable?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: indentation guilds highlight
« Reply #3 on: July 20, 2009, 09:17:51 am »
it's a shame to say that I don't know how to make a patch actually .even I read the the article about it in wiki.the color can be changed if you change the brace highlight color .
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #4 on: July 20, 2009, 09:30:20 am »
◎blueshake

1, register a user in BerliOS
2, add a patch entry in this page
http://developer.berlios.de/patch/?group_id=5358

 :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: indentation guilds highlight
« Reply #5 on: July 20, 2009, 03:14:10 pm »

Is it possible to highlight the indentation guides even when they are not shown normally?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: indentation guilds highlight
« Reply #6 on: July 20, 2009, 03:36:47 pm »
it can be shown in this way .but it seems that it don't show if the line has no indentation .see the pictures in attach .

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: indentation guilds highlight
« Reply #7 on: July 20, 2009, 05:31:49 pm »
I have applied the 'not yet created patch' to trunk : rev 5695

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #8 on: July 21, 2009, 03:41:40 am »
I have applied the 'not yet created patch' to trunk : rev 5695

I update to rev 5695, but no indent line will displayed when matching brace was highlight... :(



[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: indentation guilds highlight
« Reply #9 on: July 21, 2009, 04:54:54 am »
setting ->Editor ->General setting show indentation guides .Turn it on .
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #10 on: July 21, 2009, 05:03:58 am »
setting ->Editor ->General setting show indentation guides .Turn it on .
thanks, but I found that the line is too short. not connect between two braces.
see the attachment.


[attachment deleted by admin]
« Last Edit: July 21, 2009, 05:06:14 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: indentation guilds highlight
« Reply #11 on: July 21, 2009, 05:16:00 am »
it don't  show because it have no indentation in the line . add indentation in the line ,it will show ,I
don't konw why .
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #12 on: July 21, 2009, 01:03:40 pm »
hi, if this file was opened in Notepad++, the line shows quite well. see the screen shot:


[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: indentation guilds highlight
« Reply #13 on: July 21, 2009, 01:35:26 pm »
Also, I found the indentation guids line will "break" after I save my cpp file. see the screen shot below:

The first image was before saving.
The second image was captured after saving

[attachment deleted by admin]
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: indentation guilds highlight
« Reply #14 on: July 21, 2009, 02:23:36 pm »
This is because C::B removes the whites spaces at the end of the line, so this is not a new case...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]