Forum > Editor

Feature request/suggestion about file saving

<< < (2/8) > >>

440bx:
Domingo,

Thank you very much.

It works but not quite the way it should work.  For some reason when switching, Lazarus does save the file but, it takes several seconds and multiple switchings before my editor sees the changes in the file.

That does not happen when using the normal "Save" (ctrl_s) or "Save all".  When using "Save"/"Save all"/"Ctrl-s" my editor sees the changes instantly.

As strange as it may sound, it looks like the line:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  LazarusIDE.DoSaveAll([]);is not equivalent to manually doing a "Save all" or "Save".

The problem I described above occurs when switching from Lazarus directly to my editor. 

Strangely, if I switch back to my editor by clicking on my editor's icon on the taskbar then the changes appear immediately.

Summary: when switching directly something isn't quite right, it looks like the file's modified date and time are not updated immediately.  when switching by means of the taskbar then the changes appear immediately.


DomingoGP:
I think that the problem is in the sequence of events.

Your Editor becomes active and checks for changed files before lazarus becomes inactive and saves the files, whereas saving in the IDE ‘Save all’ saves the files and when your editor becomes active it detects the changes.

Changing using taskbar: TaskBar becomes active, lazarus becomes inactive and save the files,  taskbar becomes inactive, editor becomes active and see the changes.

Right now I have no idea how to fix it, sorry.

440bx:

--- Quote from: DomingoGP on July 27, 2024, 04:58:43 pm ---Right now I have no idea how to fix it, sorry.

--- End quote ---
That's fine.  I appreciate your efforts and switching using the taskbar is just a small extra step, no big deal.

Thank you again.

JuhaManninen:

--- Quote from: 440bx on July 27, 2024, 08:20:28 pm ---... and switching using the taskbar is just a small extra step, no big deal.

--- End quote ---
Yes, using the OS taskbar or using the "Save All" button in Lazarus main window coolbar or the same button placed in the editor toolbar.
They all require just one click.

I am a little curious why you want to use another editor. Programming is not only writing code but also studying existing code and IMO Lazarus editor is very good for that. You can quickly jump to definitions and ancestors etc. and then back. The integrated help system is rather good, too.

Joanna from IRC:
I’m also curious about the desire to save file everytime focus is lost.
It’s easy to save all . If you are using a computer without battery backup  and your concern is a sudden power outage wouldn’t you also want to save work every minute or something? I vaguely remember word processors doing this.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version