Rereading your post:
After I add some unit in Code edit window of laz1.lpi then close laz1.lpi and open laz2.lpi, this unit will appear in code edit window of laz2.lpi too. Same with delete some unit from laz1.lpi or from laz2.lpi.
Is this about units OPEN in the EDITOR window?
Because that differs from "ADDED to PROJECT".
Did you actually test, if the IDE modifies the lpi in the "other" directory?
- Backup both lpi
- work on one project
- save and close.
- use a diff tool to see if the other lpi was modified.
------------------------
The windows open in the editor, are stored in the session (and you can open files, that do NOT belong to the project, yet will be remembered).
The session can be stored either:
- as part of the lpi
- as lps file in the project folder
- as lps file in the global lazarus conf dir (primary config path)
And in the last case, if both projects have the same name, that will mean they share a session.
Go to menu: Project > Project Options
then page: Project Options > Session
And it will show where your session goes.