Recent

Author Topic: Local bookmarks instead of global How?  (Read 3355 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Local bookmarks instead of global How?
« on: September 13, 2014, 06:53:42 pm »
OK I'm irritated enough to ask.
Is there a way for each open file in the editor to have its own set of bookmarks?

As it is now I only have 9 bookmarks to use on all open files and this is both a bit too small a number to have.

Usually I have to work on two or more files at the same time and I place 3 or 4 bookmarks on the relevant parts and I know I select file1 press shift+ctrl+0 and work there go to file2 shift+ctrl+0 and make sure that the changes on file1 will not brake anything there repeat for the rest of files.

So having global bookmarks is a bit unneeded at this time at least is there a way to force them to be different per editor?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Local bookmarks instead of global How?
« Reply #1 on: September 13, 2014, 07:55:44 pm »
There's no way I know of to do this :-(

I've just tried Notepad++ and Geany to see if they supported bookmarks (I was thinking of what options you had outside the IDE), but neither seem to.
Only idea I can think of is for you to set // TODO: flags in your code, then use the ToDo list to jump between your units.  It's nowhere as useful as keyboard shortcuts I'll admit, but sorry - it's all I can think of...
If you are in this situation often, may be worth putting a feature request in... 
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Local bookmarks instead of global How?
« Reply #2 on: September 13, 2014, 08:16:11 pm »
Yes, after a quick glance at the source code, apparently they look definitively global (though I may be wrong). And only 10 seems a bit short, indeed ...

Furthermore, apparently this limitation is hard coded everywhere:
Code: [Select]
for i := 0 to 9 do
...

Concerned files (IDE):
- editor_indent_options.pas (1)
- editor_general_options.pas (1)
- main.pp (1)
- sourceeditor.pp (10)
- sourcemarks.pas (1)

I guess that modifying this upper limit could -at first glance- be possible, except perhaps for the associated icon for each bookmark (the small number in a blue circle).

There is a comment into sourcemarks.pas which could indicate more additional code in order to increase this limit:

Code: [Select]
  // synedit expects the first 10 icons for the bookmarks
  for i := 0 to 9 do
    AddImage('bookmark'+IntToStr(i));

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Local bookmarks instead of global How?
« Reply #3 on: September 14, 2014, 09:18:08 pm »
Thanks everyone for the feedback, I'll take a closer when my desktop is fixed and I'll be able to work with the trunk once more. My money at this time is on an expert that will add local bookmarks with out messing up the existing global bookmarks.

My main concern being that since synedit (I assume that because the comment say "the first 10" it means that it can accept more than 10)  supports more than 10 bookmarks how to avoid tripping up the existing bookmarks and at a less extend being able to have the shortcuts used by my expert managed (changed/saved/loaded etc) from the the existing keyboard setup on the the "tools\options\Key Mappings" page.

Any way more on the subject in the future.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Local bookmarks instead of global How?
« Reply #4 on: September 15, 2014, 09:51:23 am »
...(I assume that because the comment say "the first 10" it means that it can accept more than 10)...

That's also what I guess.

And in this topic,( http://forum.lazarus.freepascal.org/index.php/topic,14948.msg79794.html ), Martin_fr has written, concerning SynEdit:
Quote
A Mark does not necessarily have to be a bookmark. the marks have a flag, if they are a bookmark.

You can add as many marks as you want. You can add more bookmarks too, if you provide images. you can have the multiply bookmarks with the same number...

SynEdit has internal images for bookmarks 0-9. All other images you must provide.

I guess he could provide more valuable additional informations councerning this subject.

 

TinyPortal © 2005-2018