Author Topic: Multi File editing  (Read 74896 times)

mariocup

  • Guest
Re: Multi File editing
« Reply #15 on: June 16, 2008, 05:02:31 pm »
The patch is really cool :D

It would be nice if the configuration of the split windows is saved per project. As far as I know codeblocks saves only the open files and the tab positions in the .layout files. Is there a chance to save the split settings too?

Thx,

Mario

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Multi File editing
« Reply #16 on: June 16, 2008, 05:27:37 pm »
I think we all here love the work of "Der Meister".

Hence just to avoid the "apply, apply" questions:
IMHO this patch has to be used very carefully and is a very special case due to:
1.) Binary compatibility with 08.02 basically is lost.
2.) This mix of wxFlatNotebook / wxAuiNotebook should be cleaned up (as "Der Meister" suggested: Make all wxAuiNotebook).
3.) MAC testing is needed, too.
4.) Layout should be saved (as mariocup suggested).
5.) We need some time for plugin devs to adopt.

So this does not mean it will be rejected (of course not) but it most likely will not appear in the nightlies any time soon. It is more likely to appear in a special branch which needs to be maintained by somebody obviously, probably until the next official release.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Multi File editing
« Reply #17 on: June 16, 2008, 05:56:16 pm »
really cool! no more third party components  :)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Multi File editing
« Reply #18 on: June 16, 2008, 08:12:34 pm »
really cool! no more third party components  :)

wxScintilla, TinyXml  8)

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Multi File editing
« Reply #19 on: June 16, 2008, 09:20:09 pm »
Der Meister,
Great!  Based on some very quick tests, this appears to be is a very useful feature.
However, I am a little puzzled about the removal of the splitting mechanism.
... This patch also removes the old editor splitting mechanism as it is no more required.
At times, it is very handy to have split views of the same file.
Using your patch, I could not figure out how to do that.  Perhaps, I am missing something.
Thanks for your good work.
rhf

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #20 on: June 16, 2008, 09:48:18 pm »
No, you are not missing anything.

I know that it is not possible to have two views of the same file with this patch any more. However, as far as I know this feature wasn't used very often. wxAuiNotebook has some splitting mechanism, therefore this feature could probably be kept even with this patch. But I don't think this is worth the effort and splitting editors in an already splitted notebook might even be somewhat confusing. I would like to hear more opinions on that issue.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Multi File editing
« Reply #21 on: June 16, 2008, 09:50:32 pm »
No, you are not missing anything.

I know that it is not possible to have two views of the same file with this patch any more. However, as far as I know this feature wasn't used very often. wxAuiNotebook has some splitting mechanism, therefore this feature could probably be kept even with this patch. But I don't think this is worth the effort and splitting editors in an already splitted notebook might even be somewhat confusing. I would like to hear more opinions on that issue.
Der Meister ++  :)

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Multi File editing
« Reply #22 on: June 16, 2008, 10:01:17 pm »
But I don't think this is worth the effort and splitting editors in an already splitted notebook might even be somewhat confusing. I would like to hear more opinions on that issue.
OK!  If it is either/or, I would definitely prefer having the multiple file editing capability.
rhf

mariocup

  • Guest
Re: Multi File editing
« Reply #23 on: June 16, 2008, 10:36:25 pm »
Hi Meister,

I agree that multiple editors are more important than a splitting view of a single file, but in some cases it can be useful, e.g. if you have a source file with a lot of lines and you want to compare two functions within one module.

In my eyes it is important to save the layout of the multiple editor views.:D

Bye,

Mario

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Multi File editing
« Reply #24 on: June 17, 2008, 07:51:35 am »
wxScintilla, TinyXml  8)

hehe, I forgot those!  :P

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Multi File editing
« Reply #25 on: June 18, 2008, 02:42:41 pm »
Mmmmh... one thing I have noticed:
If I search in files and click on the list of search results the file is opened, the line is focussed but not highlighted anymore. That's quite annoying as you don't really see where you are... there is even no cursor.

Can somebody confirm this? (I am not sure whether it's related to this patch...)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #26 on: June 18, 2008, 03:09:26 pm »
It works for me as soon as the editor gets the keyboard focus. I guess this should automatically happen by the following lines in editormanager (function SetActiveEditor):
Code
    if (ed->IsBuiltinEditor())
        static_cast<cbEditor*>(ed)->GetControl()->SetFocus();
Therefore either cbEditor::m_IsBuiltinEditor isn't set to true or cbStyledTextCtrl::SetFocus doesn't work (anymore).

Edit: cbEditor::m_IsBuiltinEditor seems to be true. I don't think that wxPanel::SetFocus has a bug. The issue here on my system os probably related to my window-manager. It is configured in the way that the window below the mouse cursor gets the keyboard focus which isn't the editor in this case. Therefore I guess everything is working fine here for me. It could still be an issue with the patch I posted on berlios because my local working copy already has a lot more modifications (no more wxFlatNotebook for example).
« Last Edit: June 18, 2008, 03:39:17 pm by Der Meister »
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Multi File editing
« Reply #27 on: June 18, 2008, 05:08:08 pm »
Code
    if (ed->IsBuiltinEditor())
        static_cast<cbEditor*>(ed)->GetControl()->SetFocus();
This seems in fact to work... but different now. I realised the following:
If you click on a search result you are taken to the right tab (editor) in the view(s). This tab also gets active - so this seems to work. If you press the TAB key now (on Windows) the content of the editor becomes active and the line is highlighted correctly (and the cursor appears). It seems as if the editors tab (where the file name stands) gets activated first. Very, very strange...

At least it gives a clue and is really caused by the patch...

my local working copy already has a lot more modifications (no more wxFlatNotebook for example).
Oh dear... that *really* sounds great... Time to open a SVN branch then... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Multi File editing
« Reply #28 on: June 19, 2008, 04:55:35 pm »
Very, very strange...
OK - I found a way to "reproduce" (it's very simple):
- Have an editor opened and an active line in the editor (visible cursor).
- Now just switch to another application (using ALT+TAB) and then back to C::B.

In my case the editors tab is now selected , the actual editor's content (source code) is not and therefore no line highlighted, no cursor etc... Is this the usual behaviour of a wxAuiNotebook?

Anyone using this patch on Windows/Linux, please tell me: What happens to you?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #29 on: June 25, 2008, 06:57:02 pm »
Before I put more effort into this I would like to ask the devs a question: Is this patch desired and will it be applied somewhere in the future? I know it won't be applied immediately because this patch implies big changes (MortenMacFly already named the issues) but I don't want to sacrifice a lot of work for it if no one is willing to apply it to the main codeline.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.