Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
indentation guilds highlight
ollydbg:
I found the reason why the indent line will break.
First, if we check "show indent line" in the editor dialog. This function will be called.
src\sdk\wxscintilla\src\wxscintilla.cpp line 1301
--- Code: ---void wxScintilla::SetIndentationGuides (int indentView)
{
SendMsg(SCI_SETINDENTATIONGUIDES, indentView, 0); //Set breakpoint here
}
--- End code ---
So, I set a breakpoint there, and found the parameter indentView = 1.
Refer to the scintilla document:
--- Quote ---SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES
Indentation guides are dotted vertical lines that appear within indentation white space every indent size columns. They make it easy to see which constructs line up especially when they extend over multiple pages. Style STYLE_INDENTGUIDE (37) is used to specify the foreground and background colour of the indentation guides.
There are 4 indentation guide views. SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on empty lines.
SC_IV_NONE No indentation guides are shown.
SC_IV_REAL Indentation guides are shown inside real indentation white space.
SC_IV_LOOKFORWARD Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line. If the previous non-empty line was a fold header then indentation guides are shown for one more level of indent than that line. This setting is good for Python.
SC_IV_LOOKBOTH Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line or previous non-empty line whichever is the greater. This setting is good for most languages.
--- End quote ---
and
In the scr/sdk/wxscintilla/src/scintilla/include/Scintilla.h line 215
--- Code: ---#define SC_IV_NONE 0
#define SC_IV_REAL 1
#define SC_IV_LOOKFORWARD 2
#define SC_IV_LOOKBOTH 3
--- End code ---
So, the SC_IV_REAL will be used, which will cause a indentation line break.
So, I suggest that we can use:
SC_IV_LOOKFORWARD or SC_IV_LOOKBOTH.
By the way, I'd thank rhf for his help to find the reason!!!
ollydbg:
hi, this is the patch to get a continuous indentation guilds line.
--- Code: ---Index: cbeditor.cpp
===================================================================
--- cbeditor.cpp (revision 5697)
+++ cbeditor.cpp (working copy)
@@ -41,6 +41,8 @@
#include "encodingdetector.h"
#include "projectfileoptionsdlg.h"
+#include "wxscintilla/src/scintilla/include/Scintilla.h"
+
const wxString g_EditorModified = _T("*");
#define ERROR_MARKER 1
@@ -1081,7 +1083,7 @@
}
control->SetUseTabs(mgr->ReadBool(_T("/use_tab"), false));
- control->SetIndentationGuides(mgr->ReadBool(_T("/show_indent_guides"), false));
+ control->SetIndentationGuides(mgr->ReadBool(_T("/show_indent_guides"), false)!=false?SC_IV_LOOKBOTH:SC_IV_NONE);
control->SetTabIndents(mgr->ReadBool(_T("/tab_indents"), true));
control->SetBackSpaceUnIndents(mgr->ReadBool(_T("/backspace_unindents"), true));
control->SetWrapMode(mgr->ReadBool(_T("/word_wrap"), false));
@@ -2853,7 +2855,8 @@
cbStyledTextCtrl* control = GetControl();
int pos = control->PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
int style = control->GetStyleAt(pos);
- NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, event.GetX(), event.GetY());
+ if(IsContextMenuOpened()==false)
+ NotifyPlugins(cbEVT_EDITOR_TOOLTIP, style, wxEmptyString, event.GetX(), event.GetY());
OnScintillaEvent(event);
}
--- End code ---
Also, this patch disable the tooltip message if a context menu was opened.
Jenna:
Fixed in trunk (r5698) and (together with indendation-guide highlight) in cc-branch (r5699).
Thanks ollydbg.
By the way, if you quote from source-code, it would be nice to also know the filename and if possible the line in the file.
EDIT:
just the indendation-guide fix.
My changes and your post crossed each other.
ollydbg:
Ok, I know, and I have modified my previous posts.
Your patch is better than mine, it can avoid include another header "Scintilla.h", because the indentation guilds type was also defined in "include\wxscintilla\include\wx\wxscintilla.h" Line 186
--- Code: ---#define wxSTI_IV_NONE 0
#define wxSTI_IV_REAL 1
#define wxSTI_IV_LOOKFORWARD 2
#define wxSTI_IV_LOOKBOTH 3
--- End code ---
:D
blueshake:
nice work. :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version