Hi Martin,
thanks to your instructions I made a modification. Here is what I've made, may be it is worth for someone. Sorry if this message will be ugly, I have still to learn how to use this forum.
In the file ide/main.pp I modified TMainIDE.OnSrcNotebookEditorDoSetBookmark().
The whole body has been replaced with this one:
(* ignore toggle and assume is always true.
if there is a bookmark here, delete it and exit.
if there is not, search a free one; if none found, take "0"
set it.
*)
{$push}{$R-} // range check off
Inc(BookmarksStamp);
{$pop}
ActEdit := Sender as TSourceEditor;
NewXY := ActEdit.EditorComponent.CaretXY;
for id := 0 to 9 do begin
// is there a bookmark?
AnUnitInfo := TUnitInfo(Project1.Bookmarks.UnitInfoForBookmarkWithIndex(ID));
OldEdit := nil;
if (AnUnitInfo <> nil) and (AnUnitInfo.OpenEditorInfoCount > 0)
then OldEdit := TSourceEditor(AnUnitInfo.OpenEditorInfo[0].EditorComponent);
if (OldEdit<>nil) and OldEdit.EditorComponent.GetBookMark(ID,OldX{%H-},OldY{%H-}) then begin
if OldY=NewXY.Y then begin
// it is there, remove and exit
OldEdit.EditorComponent.ClearBookMark(ID);
exit
end
end
end;
// search a free one, take 0 if no free found
ID := 0;
while Project1.Bookmarks.BookmarkWithID(ID) <> nil do begin
inc(ID);
if ID > 9 then begin
id := 0;
break
end
end;
ActEdit.EditorComponent.SetBookMark(ID,NewXY.X,NewXY.Y);
// < done
// original code follows
(*
.... (original code commented out)
*)
This is a quick and maybe horrible hack; I just tested it for 30 seconds and it seems to do what I want.
Have a nice day, best regards,
linuxfan