When reloading files changed on disk, IDE doesn't reload changes in LFM
Original Reporter info from Mantis: Manlio
-
Reporter name: Manlio
Original Reporter info from Mantis: Manlio
- Reporter name: Manlio
Description:
While a file e.g. UNIT1 is open in the IDE, and both PAS and LFM are modified on disk (e.g. by SVN Update), and you accept the prompt to reload the file from the disk, the source code (PAS file) is indeed reloaded, but the form (LFM) is not. The old form remains loaded in the IDE.
Only if you immediately manually close and reopen UNIT1, the new form is indeed reloaded. But if you make any changes to the form (e.g. add components, change size, etc.) then these changes will overwrite the changes on the disk, and all the changes received (e.g. via SVN Update) will be lost, and quite possibly break the build because there may no longer be a correspondence between components in the LFM and components in the source code.
Steps to reproduce:
-
Have Unit1 with a form and a button and some code, open in the IDE.
-
Do a Subversion Update, in which Unit1 code has changed -- BOTH in the unit1.pas and in unit1.lfm. Let's say that a new button has been added to the form.
(Alternatively, manually change both .pas and .lfm files, in a text editor, while the IDE is also open)
-
When you go back to the IDE, you will receive the warning that the file on disk has changed, and you will be prompted to reload it. So far, so good.
-
Choose to reload the changed files from disk. This is where the bug takes place:
The unit1.pas file with the new code is indeed reloaded, but the form, from unit1.lfm, is NOT reloaded. You still see the old form with 1 button. -
The work-around for this bug is to close unit1 immediately from the IDE, and then reopen it. Now the new new form, with two buttons, will be loaded.
-
Note: if you don't immediately close and reopen unit1 manually, if the form is changed in any way, e.g. the position on the screen, or components changed, then this change will overwrite any changes received with the Update -- indeed you will never even see the changes in the form that should have been reloaded with unit1 after the Update.
Additional information:
I noted this problem on both Windows and MacOS IDEs, versions 2.0.6 and 2.0.10 respectively.
The solution, obviously, is that after prompting the user to reload the changed files, both the source code (.pas) and the form file (lfm) should be reloaded, and not only the .pas file
Mantis conversion info:
- Mantis ID: 37668
- Platform: Windows and Mac
- Version: 2.0.10
- Fixed in revision: r64048 (#4f131502)