Menu

#471 Make "Open last open files" do exactly that

Undefined
open
nobody
None
Feature_Request
2017-02-28
2017-01-31
Sharlene
No

Under Settings, Environment, you can check "Open last open files" to reopen files you had open when you worked with CodeBlocks last. Very nice.

However, it only opens files that were added to the project. Any other files are not reopened.

Please add a "Open ALL last open files" option, or make "Open last open files" do exactly what its name implies.

Why would I like this? Several reasons:
- It is not uncommon to open a log file or bug notes or SDK header file or something like that and refer to it. Such files are typically not in your project.
- The auto complete code sense in CodeBlocks is fantastic and can handle directories with many thousands of files no problem (ctags and gtags cant do that and choke when the tag file reaches its 2 GB limit). But you cant add many thousands of files to the project without slowing it down. (This is why we dont use Visual Studio 2015 btw, it chokes on the vast number of files, have to use make files). So ideally we can use CodeBlocks, add our code completion directories, and edit files with all the code completion and related functionality, but without having to add all files to a project, which is not doable when youliterally have tends of thousands of files.

Puh-leez?

Is there maybe plugin that can do this?

Discussion

  • ollydbg

    ollydbg - 2017-02-25

    I understand your feature request.

    However, it only opens files that were added to the project. Any other files are not reopened.

    The "last open files" information is stored in a file named "your_project_name.layout" file which is in the save folder as "your_project_name.cbp" CB project file.

    If you open two CB project files, and also open other files not belong to any projects. How to store the non-project files in the layout files? Suppose those were the opened files:

    CB project file A:  A1.cpp, A2.cpp
    CB project file B:  B1.cpp, B2.cpp
    Other files: C1.cpp C2.cpp
    

    Now, do you want to C1.cpp to saved in A.layout or B.layout?
    So, only opened file belong to the CB project is saved.

     
  • Sharlene

    Sharlene - 2017-02-28

    I see that each open project has its own layout file, and the layout file lists the files to be opened and where the cursor was etc. If you reopen CodeBlocks, it reopens all previous open projects for you. The files are open one project at the time, so the order of the tabs are not always preserved, btw.

    I can see two possible solutions:

    One: Why not simply list non project files in each project layout file? And then only open one copy when you open CodeBlocks and it restores multiple previously open projects. Anyone who does not use non project files won't be impacted, so this should be a safe change.

    Two: Ideally what codeblocks should do is have one last layout file and if you choose to restore what was previously open when you start it, it should open all the previous projects and whatever files you had open in the same order they were in before. The issue comes from having one environment that shows multiple projects and various file but then trying to save and restore that on a per project basis.

    There are many editors and IDEs (notepad++, even Visual Studio) which by default restore ALL open files when you reopen it. CodeBlocks is an exception to standard norm here.

     

Log in to post a comment.