Author Topic: Why does the code editor window close after saving a file?  (Read 404 times)

Offline Stratelier

  • Single posting newcomer
  • *
  • Posts: 2
I'm trying this IDE for the first time (latest version, 25.03), but already I've hit a major problem: every time I save any code file I'm working on, the save is successful but then the editor window closes itself.  Not just the tab for the file saved, but the entire code editor window (all tabs) -- see attachment for an example.

Is this adjustable?  I've sifted through the settings once and didn't find anything obviously relevant.  I also (temporarily) disabled ALL of the extensions, which confirmed only that it isn't extension related (the underlying issue still happens).

Sure, it is technically a "minor" issue but this is such an obvious UX breaker I simply can not negotiate.  If it's a bug then fine, but in the meantime I am already continuing my search for a (different) code editor.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1858
Re: Why does the code editor window close after saving a file?
« Reply #1 on: Yesterday at 09:25:55 am »
This issue has not been reported elsewhere before, and it is very strange. May the destination folder (or file) be write-protected?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2929
Re: Why does the code editor window close after saving a file?
« Reply #2 on: Yesterday at 07:25:46 pm »
You have only one file open. If the only file open is closed, that's what happens. The tab notebook closes also. So it looks like something has overridden the save function with a close function instead.
Codeblocks saves modified files if they are closed. But it usually asks first to do so.

I agree that this is entirely peculiar, never reported before, and I can't re-create it.
Are you saving the file with the drop down menu, or using a key combo?
Have there been any modification/overrides made to the keyboard?

Show us an image where you have two files open, then modify/save just one of them. What does that look like?
« Last Edit: Yesterday at 07:31:08 pm by Pecan »

Offline Stratelier

  • Single posting newcomer
  • *
  • Posts: 2
Re: Why does the code editor window close after saving a file?
« Reply #3 on: Today at 01:34:14 am »
This issue has not been reported elsewhere before, and it is very strange. May the destination folder (or file) be write-protected?

The file is definitely not write-protected, since I am successful in saving it (though the editor window closes after saving).

Apparently the folder is marked as read-only (I had little incentive to even check for this going in) -- though removing the lock makes no difference, the editor window still closes after a successful save.

If I have multiple files open in the editor, make changes to only one file and save it (either from the menu or with the keyboard shortcut, the effect is the same), the editor window ultimately closes in its entirety.

If I have multiple files open in the editor, make changes to two or more files, then Save one of the files, the save is successful, but the file is closed after saving, and then CB prompts me to save the other file -- implying something is clearly trying to close the entire editor window after the successful save.  If I cancel at this point, the interface is left as-is, minus the tab for the file that was just saved.

Quote
Are you saving the file with the drop down menu, or using a key combo?
Have there been any modification/overrides made to the keyboard?
I get the same result either way -- save is successful, then the editor window closes. 

One important detail is that when I save a file, the editor window's GUI refreshes after saving (yellow margin indicators turn green) and THEN the editor window closes (after some delay).  If I try to close the editor window directly and save changes when prompted, the tab disappears immediately, then the editor window closes entirely after a delay.

Oh, right, that delay may be another important detail; see new attachment (unsaved at left, saved at right, moments before the editor window closes).
« Last Edit: Today at 01:36:11 am by Stratelier »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2929
Re: Why does the code editor window close after saving a file?
« Reply #4 on: Today at 03:55:01 am »
Where did  that copy of CodeBlocks come from?

Please start CodeBlocks with the '/d' parameter to create the debug log.

After the windows disappears please show us the data written to the CodeBlocks log.
Click on the "CodeBlocks" log tab, place the mouse in the log window and scroll upward to see the data.
Right-click and choose "copy contents to clipboard".
Paste that data to use between code tags (The # icon above a reply box).

Do the same with the "Code::Blocks debug" tab and window.

We'd like to see what is being logged when you save a file.

Thanks for your reporting and patience.
« Last Edit: Today at 04:21:38 am by Pecan »