a lot of SCN_MODIFIED message sented when loading a file (one per each line)

91 views
Skip to first unread message

AsmWarrior

unread,
Jul 19, 2013, 1:01:23 AM7/19/13
to scintilla...@googlegroups.com
Hi, when I'm debugging C::B, I found that scintilla sent a log of SCN_MODIFIED messages for each line. see the code below:

int SCI_METHOD Document::SetLevel(int line, int level) {
    int prev = static_cast<LineLevels *>(perLineData[ldLevels])->SetLevel(line, level, LinesTotal());
    if (prev != level) {
        DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER,
                           LineStart(line), 0, 0, 0, line);
        mh.foldLevelNow = level;
        mh.foldLevelPrev = prev;
        NotifyModified(mh);
    }
    return prev;
}

The log is below:

[debug]> bt 30
[debug]#0  Editor::NotifyModified (this=0x3bff0b8, mh=...) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:4837
[debug]#1  0x6196385c in Document::NotifyModified (this=0x3bc08c8, mh=...) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:1932
[debug]#2  0x6195dc7a in Document::SetLevel(int, int)@12 (this=0x3bc08c8, line=2, level=67109888) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:358
[debug]#3  0x619d9cc2 in LexAccessor::SetLevel (this=0x22d5bc, line=2, level=67109888) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\lexlib\LexAccessor.h:197
[debug]#4  0x618d97db in LexerCPP::Fold(unsigned int, int, int, IDocument*)@20 (this=0x3bbbbd0, startPos=0, length=5052, initStyle=0, pAccess=0x3bc08cc) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\lexers\LexCPP.cxx:1185
[debug]#5  0x6195c87b in LexInterface::Colourise (this=0x3c013d8, start=0, end=5052) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:64
[debug]#6  0x61962a22 in Document::EnsureStyledTo (this=0x3bc08c8, pos=5052) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Document.cxx:1770
[debug]#7  0x6194fe76 in Editor::StyleToPositionInView (this=0x3bff0b8, pos=5052) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:6811
[debug]#8  0x61934e78 in Editor::ScrollTo (this=0x3bff0b8, line=136, moveThumb=true) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\scintilla\src\Editor.cxx:1035
[debug]#9  0x618ba7b8 in ScintillaWX::DoScrollToLine (this=0x3bff0b8, line=136) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\ScintillaWX.cpp:1313
[debug]#10 0x618b3dec in wxScintilla::ScrollToLine (this=0x3b8edf0, line=136) at F:\cb_sf_git\trunk\src\sdk\wxscintilla\src\wxscintilla.cpp:4821
[debug]#11 0x617c9437 in cbEditor::SetProjectFile (this=0x3c002b0, project_file=0x3b8c268, preserve_modified=true) at F:\cb_sf_git\trunk\src\sdk\cbeditor.cpp:937
[debug]#12 0x6182375b in EditorManager::Open (this=0x1e98c88, fileLdr=0x3bc7b88, filename="E:\\code\\cb\\test_code\\button_cover\\button_coverMain.cpp", data=0x3b8c268) at F:\cb_sf_git\trunk\src\sdk\editormanager.cpp:399
[debug]#13 0x617e1d11 in cbProject::LoadLayout (this=0x1e8d4b8) at F:\cb_sf_git\trunk\src\sdk\cbproject.cpp:555
[debug]#14 0x6187abfb in ProjectManager::EndLoadingProject (this=0x23e5528, project=0x1e8d4b8) at F:\cb_sf_git\trunk\src\sdk\projectmanager.cpp:989
[debug]#15 0x618782c0 in ProjectManager::LoadProject (this=0x23e5528, filename="E:\\code\\cb\\test_code\\button_cover\\button_cover.cbp", activateIt=true) at F:\cb_sf_git\trunk\src\sdk\projectmanager.cpp:262
[debug]#16 0x0044ad72 in MainFrame::DoOpenProject (this=0x1e72978, filename="E:\\code\\cb\\test_code\\button_cover\\button_cover.cbp", addToHistory=true) at F:\cb_sf_git\trunk\src\src\main.cpp:1832
[debug]#17 0x0044aa01 in MainFrame::OpenGeneric (this=0x1e72978, filename="E:\\code\\cb\\test_code\\button_cover\\button_cover.cbp", addToHistory=true) at F:\cb_sf_git\trunk\src\src\main.cpp:1781
[debug]#18 0x0044d259 in MainFrame::OnStartHereLink (this=0x1e72978, event=...) at F:\cb_sf_git\trunk\src\src\main.cpp:2161
[debug]#19 0x010aff27 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from E:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]>>>>>>cb_gdb:


Is this by design? if a file has lots of lines, it will generate many messages (one message for a line)

Thanks.


Neil Hodgson

unread,
Jul 20, 2013, 7:21:38 PM7/20/13
to scintilla...@googlegroups.com
AsmWarrior wrote:

Hi, when I'm debugging C::B, I found that scintilla sent a log of SCN_MODIFIED messages for each line. see the code below:
...
Is this by design?

   Yes.

if a file has lots of lines, it will generate many messages (one message for a line)

AsmWarrior

unread,
Jul 21, 2013, 11:52:28 AM7/21/13
to scintilla...@googlegroups.com, nyama...@me.com
 Hi, Neil, thanks for the reply, I understand now.

Yuanhui Zhang
Reply all
Reply to author
Forward
0 new messages