Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: blinkinhek on November 08, 2018, 05:37:33 pm

Title: Bookmarks function problems
Post by: blinkinhek on November 08, 2018, 05:37:33 pm
I am using Code::Blocks v17.12
I seem to suffer from a problem with ever-growing lists of bookmarks.
If I add a bookmark (Ctrl-B) and later remove it (Ctrl-B) at a source-code line in the editor, and exit Code:Blocks, when I later fire-up the program, I have an extra bookmark, and the original one as well. This process can be repeated. Deleting the bookmarks file cleared all the bookmarks on opening the IDE, but the problem restarts. Similarly if I delete the XML entry in the bookmarks file, but retaining the file.
Looking at an extract, the data does not make much sense to me regarding the actual values..... 
Help appreciated!
Code
	
<File name="app.h" open="1" top="1" tabpos="3">
<Cursor position="419" topLine="4" />
<BrowseMarks positions="" />
<Book_Marks positions="419,419,409,409,409,409" />
</File>
<File name="app.cpp" open="1" top="0" tabpos="9">
<Cursor position="117645" topLine="2214" />
<Book_Marks positions="117662,117656,96060,96021,117645,117645" />
</File>

Title: Re: Bookmarks function problems
Post by: oBFusCATed on November 08, 2018, 07:52:31 pm
It seems this feature is provided by the browse tracker plugin.

Can you reproduce the problem in a minimal example file?
Exact steps to reproduce would be helpful.

What OS are you using? Have you tried a night build?
Title: Re: Bookmarks function problems
Post by: blinkinhek on November 08, 2018, 08:19:49 pm
This is a really minimal single file sample using the Code::Blocks wizard:
I am running on Windows 10, but have not tried any of the nightly builds

Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
I tried adding bookmarks and removing with the following results:
1. Set 2 bookmarks lines 5 and 8, then exit codeblocks
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<BrowseTracker_layout_file>
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1">
<Cursor position="68" topLine="0" />
<BrowseMarks positions="" />
<Book_Marks positions="50,105" />
</File>
</BrowseTracker_layout_file>
2. 'Clear all bookmarks' then exit codeblocks
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<BrowseTracker_layout_file>
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1">
<Cursor position="105" topLine="0" />
<BrowseMarks positions="" />
<Book_Marks positions="105" />
</File>
</BrowseTracker_layout_file>
3. Clear all bookmarks again, exit again
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<BrowseTracker_layout_file>
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1">
<Cursor position="107" topLine="0" />
<BrowseMarks positions="" />
<Book_Marks positions="" />
</File>
</BrowseTracker_layout_file>
4. Used Ctrl B to add bookmark to line 5, Ctrl B to remove again, exit codeblocks
Code
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<BrowseTracker_layout_file>
<ActiveTarget name="Debug" />
<File name="main.cpp" open="1" top="1" tabpos="1">
<Cursor position="107" topLine="0" />
<BrowseMarks positions="" />
<Book_Marks positions="55,55" />
</File>
</BrowseTracker_layout_file>

etc
Title: Re: Bookmarks function problems
Post by: Pecan on November 09, 2018, 07:14:31 pm
This bookmark duplication was fixed in SVN r11347 (pecanh 2018-03-26) and does not occur in the current nightly builds.