Recent

Author Topic: IDE - Make it visible by the save-icon if the code is saved  (Read 2995 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1009
It would be nice, to have a red disk-save-icon, if the text of my code has changed.
And a black or grey, - if not.
So I see at any moment, if the code will be lost on my next crash.

Would be great to have this by the "save all" icon as well.
Not sure if "all" files of a code to watch, slows the IDE down. Somebody wiser will know it.

If somebody likes the idea, thank you in advance.

Handoko

  • Hero Member
  • *****
  • Posts: 5377
  • My goal: build my own game engine using Lazarus
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #1 on: July 21, 2022, 07:21:28 pm »
... have a red disk-save-icon, if the text of my code has changed.
And a black or grey, - if not.

Isn't it already implemented? See the attached animation below.
But if you have better icons, you can submit them to the developer or at least you can change it yourself, the source code of Lazarus IDE is included by default and can be modified and rebuild.

So I see at any moment, if the code will be lost on my next crash.

Did you mean your IDE crash when you try to run your code? I'm not sure about your installation, but on mine the modified source code will be saved automatically every time I run it from the IDE.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #2 on: July 21, 2022, 07:50:44 pm »
See Handoko's reply... Icons should already indicate the state. And the Title in the source edtors tabs also has an indicator (unless you have so many tabs, that they are scrolled out)

And you can see Yellow parts in the gutter on the right => they become green once saved.

So I see at any moment, if the code will be lost on my next crash.

What exactly crashes? If your app crashes, there should be no code lost.

If the IDE crashes... Well that should not happen. So you should report that. Though you need some details for the report, otherwise no one can tell why it crashed. I.e steps to reproduce. Or a stack trace (there is a --debug-log=file command line option, but there are some reports that it may not work...)

I can't remember when the IDE crashed the last time on my system. And I use it daily.
(That excludes cases where I changed the source myself, and made a mistake, but I guess you don't actually make changes to the IDE source code)

Nicole

  • Hero Member
  • *****
  • Posts: 1009
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #3 on: July 21, 2022, 08:10:11 pm »
ah!
They have.
Now, as I starred on it, I saw turning them red.
Thanks.

Nicole

  • Hero Member
  • *****
  • Posts: 1009
[solved] Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #4 on: July 21, 2022, 08:11:15 pm »
It would be nice, to have a red disk-save-icon, if the text of my code has changed.
And a black or grey, - if not.
So I see at any moment, if the code will be lost on my next crash.

Would be great to have this by the "save all" icon as well.
Not sure if "all" files of a code to watch, slows the IDE down. Somebody wiser will know it.

If somebody likes the idea, thank you in advance.
It would be nice, to have a red disk-save-icon, if the text of my code has changed.
And a black or grey, - if not.
So I see at any moment, if the code will be lost on my next crash.

Would be great to have this by the "save all" icon as well.
Not sure if "all" files of a code to watch, slows the IDE down. Somebody wiser will know it.

If somebody likes the idea, thank you in advance.

af0815

  • Hero Member
  • *****
  • Posts: 1379
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #5 on: July 21, 2022, 08:17:32 pm »
So I see at any moment, if the code will be lost on my next crash.
I work on a fulltime job with lazarus, and i have not this problem.

You can see the state on the icons without a problem and save often (and make a commit in git) is good. Lazarus normaly is not crashing. I can foce it by crazy things, but not under normal heavy programming.
regards
Andreas

Handoko

  • Hero Member
  • *****
  • Posts: 5377
  • My goal: build my own game engine using Lazarus
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #6 on: July 21, 2022, 08:22:05 pm »
My Lazarus never crash.
 ;D

Actually, it ever crashed but that happened because my whole system crashed.

Nicole

  • Hero Member
  • *****
  • Posts: 1009
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #7 on: July 21, 2022, 08:44:02 pm »
Take a lesson by me!
I manage Lazarus to crash, I manage it to behave fuzzy on every click (restart helps) and I manage my application compiling fine, but not starting any more, because the form is damaged and I have no idea how and why.

I bet, you can understand better now my question for "saving". :-[

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #8 on: July 21, 2022, 09:00:11 pm »
Well, the more important bit is how to stop it from crashing, isn't it?

Tools > Configure build lazarus
- In the box "custom options": -gw -gl -O-1 -Criot
- Select the radio-button "Clean all"
- Press the "build" button. (this will take between 1 and 2 minutes depending on your PC hardware)

Are you on Windows?
Edit the shortcut to lazarus (or create a shortcut to lazarus.exe).
Context menu > Properties
- The is a field "Target" that contains "C:\lazarus\lazarus.exe"
  Make it "C:\lazarus\lazarus.exe --debug-log=C:\lazlog.txt"


After the next crash, check if the file contains any
- error message
- stack-trace (unit names and line numbers)

If yes, upload those. And if you can, tell us what you did right before the crash.


Nicole

  • Hero Member
  • *****
  • Posts: 1009
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #9 on: July 21, 2022, 11:29:59 pm »
your posting is saved for a "rainy day"! Thx.
 -gw -gl -O-1 -Criot
What do they do?

and btw: Why does my Lazarus not stop on breakpoints any more?
I compiled as "debug version" and thought this should be? - is it?

Yes, Windows.
Running on Win 7, using programs on Win 10.
Someone here hinted me to use Win 7, I changed back and am that happy about.

Where shall I upload crash files?
(What is needed? I suppose, OS, Lazarus versions and source app?
I discoverd a huuuge file on my disk which is similar than "debug" or so and am not sure, what is debugged. And why it is that huge.)
I needed patience of smart people because I repeatedly used wrong portals for my things.

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #10 on: July 22, 2022, 12:01:42 am »
your posting is saved for a "rainy day"! Thx.
 -gw -gl -O-1 -Criot
What do they do?
manual read: https://www.freepascal.org/docs-html/user/userap1.html

-gw        Generate DWARFv2 debug information (same as -gw2)
-gl        Use line info unit (show more info with backtraces)
-O-        Disable optimizations

1 behind -O- that I not have see before. Maybe type error ?

-Cr        Range checking
-Ci        IO-checking
-Co        Check overflow of integer operations
-Ct        Stack checking (for testing only, see manual)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #11 on: July 22, 2022, 12:35:37 am »
-O-        Disable optimizations

1 behind -O- that I not have see before. Maybe type error ?

No, it's intention. It's short for  -O- -O1

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE - Make it visible by the save-icon if the code is saved
« Reply #12 on: July 22, 2022, 12:50:27 am »
your posting is saved for a "rainy day"! Thx.
If you apply the settings, and change the shortcut, then you can use the IDE as normal.


Quote
Where shall I upload crash files?
(What is needed? I suppose, OS, Lazarus versions and source app?
You can discuss the info on the forum first. But then on the bugtracker.


Quote
I discoverd a huuuge file on my disk which is similar than "debug" or so and am not sure, what is debugged. And why it is that huge.)
What filename?

something.dbg ?
.dbg files are created if you select "use external debug info" (which is really pointless in 99% of all cases).
.dbg files contain the info for the debugger, which is otherwise included in the exe (which is a much better place)


Quote
and btw: Why does my Lazarus not stop on breakpoints any more?
I compiled as "debug version" and thought this should be? - is it?

What colors/symbol do the breakpoints get after you started the app?

If you do have "use external debug info" (project options > compiler options > debugging)  enabled => switch it off. It should work, but it does add potential points of failure....

Do you have a debugger set under:
  Tools > Options > Debugger Backend
and
  Project Options > Project Options > Debugger  (drop down, should be "use ide default")

 

TinyPortal © 2005-2018