Again on IDE/editor bookmakrs lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- linuxfan · 2016-04-26 09:16 Hi all. I am missing a functionality about bookmarks: "toggle bookmark" (set / unset), exactly the same way as it works with breakpoints. My suggestion is, if possible, to turn "Set a free bookmark" to "Toggle bookmark". Anyway, thanks for this great tool; even with some quirks, is already the best around. ---------------------------------------------------------------------- Martin_fr · 2016-04-27 17:31 please create a request on the bugtracker. If you are interested in looking at it yourself: 1) Search all files in the folder ide (and maybe components/ideIntf) for ecSetFreeBookmark and create a new command ecToggleFreeBookmark (you do not necessarily need menu entries) 2) in ide/main.pp look at procedure TMainIDE.OnSrcNotebookEditorDoSetBookmark add something like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   if (ID < 0) and toggle then begin    // search all editors for a mark on the given line     // the code in the function serves well as example  end;  advanced mouse options allow to assign this to the mouse buttons if you want. ---------------------------------------------------------------------- linuxfan · 2016-04-28 18:32 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 ---------------------------------------------------------------------- MichaelBM · 2016-04-28 18:44 I'm using Lazarus 1.6 on Windows 10 and all the requested functions are already implemented as default. Just right-click with your mouse in the editor. ---------------------------------------------------------------------- linuxfan · 2016-04-29 06:23 > I'm using Lazarus 1.6 and all the requested functions are already implemented as default. I didn't notice that: while editing, I use the mouse as less as possible. So, thank you. Instead of exploring right-click menu,  I went to "editor preferences"/"keyboard shortcuts", and only found "Set bookmark [0..9]" and "Goto bookmark [0..9]". There was no way to invert or delete a single bookmark. Very strange! So i rolled down my own solution... Only now I see that, at least in my translation, functions for inverting bookmarks are called "Invert marker [0..9]". The different words bookmark-marker make impossible to see all the related functions at the same time. I discover that after your suggestion. Anyway, I don't like the original lazarus way, and still prefer my modification because using a single keystroke I can set or delete a bookmark without worrying about its number. It's a matter of habit. Only now I fully understand the suggestion of Martin_fr, which was talking about a toggle flag which seemed never used... I could think at a cleaner way to do what I want; meantime, I think that the text associated with bookmarks, or at least their translations, have a problem. I will post a bug report. Thank you all and regards, linuxfan ---------------------------------------------------------------------- MichaelBM · 2016-04-30 13:12 Have you tried using Ctrl+Shift+[1..9] ? This key combination sets/deletes bookmarks in the Windows version af Lazarus. Pretty nice! ---------------------------------------------------------------------- totya · 2018-06-06 11:21 Hi, bookmarks works for me in IDE, except for package files... after open package, bookmarks seems to me lost. ---------------------------------------------------------------------- Martin_fr · 2018-06-06 12:14 Are you sure the same bookmark is not set in any other file that is already open? ---------------------------------------------------------------------- totya · 2018-06-06 15:36 Hi! Yes, I'm exactly soure. My simple question, if I works with package files, where is the bookmark storage (config) file? Okay, I play with it, and I found what is the problem, for bookmarks save, need a project. lol. For example: file-new/simple application. But is unneccessary for packages... Packages doesn't save bookmarks without an open project as I see. ---------------------------------------------------------------------- Martin_fr · 2018-06-06 18:09 Ok, I see. Yes bookmarks are stored in projects only. If you set a bookmark in a package, then that is stored in the project which is open at the time. Same as the rest of the session, e.g which files from which package are open in an editor. If you open the same package in a diff project, then it will have whatever bookmarks that other project has. ------------------- Note: The Lazarus IDE *always* has a project open. It currently can not work without one. Even if you close all files in all editors, the project is still open. You can close the project in the project menu. But then the IDE will immediately ask you which other project to open, and you can do nothing until you open/create one. ---------------------------------------------------------------------- totya · 2018-06-06 19:37 Martin_fr: Thank you for these useful informations!