News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

indentation guilds highlight

Started by blueshake, July 20, 2009, 05:02:45 AM

Previous topic - Next topic

blueshake

Hello :
     I found that indentation guilds can not highlight in codeblock.So I did a little work for it .
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?

ollydbg

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.

geiermeier

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?

blueshake

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?

ollydbg

◎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.

danselmi


Is it possible to highlight the indentation guides even when they are not shown normally?
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

blueshake

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?

killerbot

I have applied the 'not yet created patch' to trunk : rev 5695

ollydbg

Quote from: killerbot on July 20, 2009, 05:31:49 PM
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.

blueshake

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?

ollydbg

#10
Quote from: blueshake on July 21, 2009, 04:54:54 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]
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.

blueshake

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?

ollydbg

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.

ollydbg

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.

oBFusCATed

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!]