Author Topic: MiniDoc  (Read 24499 times)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: MiniDoc
« Reply #15 on: August 12, 2014, 11:07:09 pm »
I just send you a pull request with my solution for the resize-stuff.
My fork was created short before your resize-commit.

It goes a slightly different way, because I connect to the first cbStyledTextCtrl instead of the editor.
So resize-events in split-view are recognized also.

Because of your last commit, the pull-request can not be merged directly (merge-conflicts).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9473
Re: AW: MiniDoc
« Reply #16 on: August 12, 2014, 11:09:19 pm »
Another nice example that git is not always helpful... :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: AW: MiniDoc
« Reply #17 on: August 12, 2014, 11:16:26 pm »
Another nice example that git is not always helpful... :-)
That has nothing to do with git, but with two developers working on the same problem ath the same time.
With svn you can not even create a pull-request.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #18 on: August 13, 2014, 12:44:47 am »
Can you explain how to reproduce?
See default colors of the c++ theme to dark gray and light gray. Then try to open the MiniDoc panel. If it still works correctly then I can share my theme...
(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!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #19 on: August 13, 2014, 10:31:02 am »
...
It goes a slightly different way, because I connect to the first cbStyledTextCtrl instead of the editor.
So resize-events in split-view are recognized also.
Applied your patch, thanks a lot. It is not working when the second splited view changes size (hide/show logs resizes only second view).


... for splitted editors ... is more broken (at least here): the actual highlighted lines (grey rectangle) get a white circle in the editors margin of the second control.
Its because the marker MiniStyledTextCtrl::GetOurMarkerNumber() is not defined as wxSCI_MARK_EMPTY. And other unused marker numbers have other visible marker settings.
A simple solution is to define all markers (0..wxSCI_MARKER_MAX] as wxSCI_MARKER_EMPTY after creation of cbStyledTextCtrl (in cbEditor). like this:
Code: [Select]
Index: cbeditor.cpp
===================================================================
--- cbeditor.cpp (revision 9855)
+++ cbeditor.cpp (working copy)
@@ -782,6 +782,7 @@
     m_pControl->SetMarginMask(C_MARKER_MARGIN,    0);
     m_pControl->SetMarginMask(C_CHANGEBAR_MARGIN, 0);
     m_pControl->SetMarginMask(C_FOLDING_MARGIN,   0);
+    InitMarker(m_pControl);
 
     SetEditorStyleBeforeFileOpen();
     m_IsOK = Open();
@@ -797,6 +798,13 @@
     }
     ConnectEvents(m_pControl);
 }
+void cbEditor::InitMarker(cbStyledTextCtrl* control)
+{
+    if(!control)
+        return;
+    for (int marker = 0 ; marker <= wxSCI_MARKER_MAX ; ++marker)
+        control->MarkerDefine(marker, wxSCI_MARK_EMPTY);
+}
 
 void cbEditor::NotifyPlugins(wxEventType type, int intArg, const wxString& strArg, int xArg, int yArg)
 {
@@ -1095,6 +1103,7 @@
 
     // create the right control
     m_pControl2 = CreateEditor();
+    InitMarker(m_pControl2);
 
     // update controls' look'n'feel
     // do it here (before) document is attached, speeds up syntaxhighlighting

I tried to define the marker from the MiniDoc plugin, but there I don't know when a splitted view gets created. Right?


regards

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #20 on: August 13, 2014, 08:41:15 pm »
Can you explain how to reproduce?
See default colors of the c++ theme to dark gray and light gray. Then try to open the MiniDoc panel. If it still works correctly then I can share my theme...
I still can't see whats wrong.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #21 on: August 13, 2014, 11:07:27 pm »
(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!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #22 on: August 13, 2014, 11:37:34 pm »
This http://cmpt.benbmp.org/codeblocks/screens/minidoc.theme.png
Ahh... Thanks, now I see!

Is your theme ok when the invisible part is marked by greying out the non-visible parts? (latest sources, in config panel remove tick "inverse designator").

Can you try to patch cbEditor to init the markers ( patch from this
post)? Is it also a solution?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #23 on: August 13, 2014, 11:55:12 pm »
Can you try to reproduce the problem with this theme: http://cmpt.benbmp.org/codeblocks/screens/cb.editor.theme.conf ?
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #24 on: August 14, 2014, 12:04:36 am »
I've just tried the latest version and it seems that this error is fixed.

But there are two other errors, one minor and one more serious

serious: The last line is white, probably because you're playing with the margins. See the screenshot: http://cmpt.benbmp.org/codeblocks/screens/minidoc.line.problem.png
minor: After the plugin is loaded and then the panel is shown it is empty.
annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.

Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
Edit2: The serious problem is worsened when a line or more is deleted in the document, then multiple lines become white.
« Last Edit: August 14, 2014, 12:13:21 am by oBFusCATed »
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #25 on: August 14, 2014, 12:22:36 am »
There is another problem: When scrolling I can see the inactive lines from the minidoc drawn over the line numbers of my main editor. But I can't make a screenshot to demonstrate the artefact.
(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!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #26 on: August 14, 2014, 01:04:30 am »
serious: The last line is white, probably because you're playing with the margins. See the screenshot: http://cmpt.benbmp.org/codeblocks/screens/minidoc.line.problem.png
There is another problem: When scrolling I can see the inactive lines from the minidoc drawn over the line numbers of my main editor. But I can't make a screenshot to demonstrate the artefact.
First, I don't play with the margins. Again, apply the mentioned patch! The reason is that a cbStyledTextControl has some of the markers configured to visible symbols and colored lines.

The serious problem is worsened when a line or more is deleted in the document, then multiple lines become white.
The white lines are gone with the mentioned patch. But the grey area will still be wrong in this cases. I have to update the MiniStc more regular after typing.

minor: After the plugin is loaded and then the panel is shown it is empty.
What do you expect?

annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.
...
Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
That's true, I have to look into it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11199
    • Travis build status
Re: MiniDoc
« Reply #27 on: August 14, 2014, 08:47:30 am »
minor: After the plugin is loaded and then the panel is shown it is empty.
What do you expect?
To see the active editor in the minidoc panel.

The steps to reproduce the problem are:
1. Open some project or files
2. Enabled the minidoc
3. View -> MiniDoc

At step 3 the minidoc is still empty.

About the patch: I'll see if I can find time to try it.
(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!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #28 on: August 14, 2014, 10:23:28 am »
... To see the active editor in the minidoc panel. ...
You are right. I didn't think about loading a plugin after startup. Thanks.
I just commited the fix.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: MiniDoc
« Reply #29 on: August 14, 2014, 05:31:13 pm »
annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.

Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
It's a bug in wxScintilla, see here:
https://groups.google.com/forum/#!topic/scintilla-interest/FAI2HjSYlLk