View Issue Details

IDProjectCategoryView StatusLast Update
0034194LazarusIDEpublic2018-10-31 18:36
ReporterGary BollenbachAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilitysometimes
Status feedbackResolutionopen 
PlatformMacbook OS X 10.10OSLinuxOS VersionMint 19
Product Version1.8.4Product Build 
Target VersionFixed in Version 
Summary0034194: Bookmarks disappear when project is transferred to new directory
DescriptionWhen project files are transferred to a different directory,
the IDE will not correctly build a bookmark list, if the .pas
file is over a certain length.
Steps To Reproduce1. Open a project
2. Create bookmarks in the Lazarus editor
3. Run
4. Externally, move the .pas, .lfm, .lpr, .lps, and .lpi files to a
different directory.
5. Start Lazarus, open the relocated .lpr, initialize the project
6.Open the .pas file, right click for pop-up menu, select Goto Bookmark.
The bookmark list is empty.
Additional InformationNote 1. This bug can't be duplicated with a toy project. Tested with .pas
file of 5058 lines. When .pas reduced to 3492 lines, the bug did not occur.

Note 2. While the bug manifests, the blue balloons for the invisible bookmarks can be seen in the left editor gutter.

Note 3. The bug was observed in 2 different projects.

TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Gary Bollenbach

2018-08-28 19:32

reporter  

180828bookmark_bug.tar.gz (34,482 bytes)

Gary Bollenbach

2018-08-30 15:33

reporter   ~0110377

Note 4: In the uploaded project .pas, there are invisible bookmarks at lines 1629, 2563, and 4953.

Martin Friebe

2018-10-27 23:58

manager   ~0111627

Somehow the IDE stores a extra location to your files.
From the .lps file:

      <Unit1> // NOT the unitname
        <Filename Value="unit1.pas"/> // the unit name.
        <Bookmarks Count="3">
          <Item0 X="2" Y="2563" ID="1"/>
          <Item1 X="6" Y="1629" ID="3"/>
          <Item2 X="26" Y="4952" ID="2"/>
        </Bookmarks>

      <Unit2>
        <Filename Value="../180827 skew somewhat working/unit1.pas"/> // different unit name (relative location changed)


The path is relative to the lpr or lpi file (I need to check which / actually relative to the project directory).

This means the IDE sees 2 different unit1.pas. And it is indented that the IDE sees those 2 files as different files/units.
(This is true, even if there is a symbolic link, and the real directories are the same)

***
Only the first file has bookmarks.
So if you open unit1.pas from the 2nd location, it is correct that there are no bookmarks.
***

The question is how did you get there?

1) If you can reproduce, please check, that before you move the files, they do not have any path at all.
2) After you moved the files, if you open a file, always check, if it is from the correct directory (editor status bar, shows full filename)

Also make sure you do not copy .exe, .dbg, .ppu or .o files. They may contain pointers to the original dir, and if you debug, the IDE may open files according to the info in those files (which can be wrong after copy)

---
In other words, if files change their relative position to the project dir (or package dir, if they belong to a package), even if you set up include pathes (for fpc), then the IDE will loose session info for that file. And that is by design.

---
Feedback required:
With the above info, please try to find out what triggers the relative location to change (what adds the path to the unit name)

Martin Friebe

2018-10-31 13:00

manager   ~0111704

Last edited: 2018-10-31 13:01

View 3 revisions

The feedback is about the initial description (moving project).

I can reproduce the 2nd issue, bookmarks in gutter, but not in menu. (You may wait with the feedback, maybe the gutter/menu issue fixes the rest too)

http://forum.lazarus-ide.org/index.php/topic,42363.msg295595.html#msg295595

Martin Friebe

2018-10-31 18:36

manager   ~0111709

Found the problem, with bookmarks shown in the gutter, but not in the menu: fixed in r59402

The following has changed:

1)
If a file is opened, and bookmarks are restored from the session, they now also show in the contextmenu.

Note: Bookmarks for any file in the session that is NOT open in any editor, are not present in the IDE (not in the menu, no key-shortcut, no other reference). This has been like this before, and is by design.

2)
If a file is closed, any bookmarks this file has, will be removed from the menu.
Before this fix, bookmarks remained visible in the menu, but would not act (if called, they would not re-open the file, instead nothing would happen)

-------------------
When providing feedback on the rest of the issue, please verify, that any bookmark "lost" while copying a project to a new directory, is only checked/expected to exist, if the file (in which it is set) is open in an editor.

Issue History

Date Modified Username Field Change
2018-08-28 19:32 Gary Bollenbach New Issue
2018-08-28 19:32 Gary Bollenbach File Added: 180828bookmark_bug.tar.gz
2018-08-28 19:39 Martin Friebe Assigned To => Martin Friebe
2018-08-28 19:39 Martin Friebe Status new => assigned
2018-08-30 15:33 Gary Bollenbach Note Added: 0110377
2018-10-27 23:58 Martin Friebe LazTarget => -
2018-10-27 23:58 Martin Friebe Note Added: 0111627
2018-10-27 23:58 Martin Friebe Status assigned => feedback
2018-10-31 13:00 Martin Friebe Note Added: 0111704
2018-10-31 13:00 Martin Friebe Note Edited: 0111704 View Revisions
2018-10-31 13:01 Martin Friebe Note Edited: 0111704 View Revisions
2018-10-31 18:36 Martin Friebe Note Added: 0111709