![]() |
General Programming »
Macros and Add-ins »
DevStudio Add-ins
Intermediate
Visual Studio Bookmark Saver Add-InBy Jignesh PatelVisual Studio add-in which saves and restores bookmarks after closing and re-opening a file. |
VC6, MFC, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

The feature to set bookmarks (using Ctrl-F2) in a text file available in the Dev Studio editor is very useful when going through a HUGE source file. The drawback is that, once the text file is closed you lose all the bookmarks set in that particular file and it's a pain to set them all again.
So, anyway I guess you know what this add-in does by now. It, remembers the bookmarks set in a file (as shown above) and re-sets them back if the file is opened later in Dev Studio.
The add-in runs without user interaction.
You do have a choice to set the options. You can enable or disable the bookmark add-in on the fly (by choosing the Bookmark command which brings up the dialog box as shown below).

Disabling the bookmark add-in will not restore your bookmarks the next time you open the file.
The user also has the option of saving the bookmark locations
The delete file button simply purges any bookmark locations that you might have accumulated during your long hours of coding

The first version of the add-in was quite inflexible in the manner that the user couldn't selectively remove bookmark locations stored in the file. Well, now the user can selectively remove a line or the whole file. I'll let you play around with the add-in.
Un-check the bookmark add in (in the tools customize page). Delete the bookmark.dll and also, a file called bookmark.dat (which is automatically created by the add-in) which is stored where the user specifies.
Now the users can remove files or lines in the advanced page with the use of the keyboard. Just press the delete key. The user can also open any file by using the F3 key. Double clicking on the line number will open the file and scroll to the line number and highlight the line to give you an indication as to where the bookmark is set. F3 works with both Files and Line numbers.
DevStudio process did not seem to terminate itself properly when users would open a file from the dialog box (using the F3 key or choosing the menu option available). I don't know why this seems to happen, so to prevent from DevStudio's process not terminating properly, I have removed the functionality whereby the user can open a file until I find out exactly why this happens. - Bug found (it's the nasty one described below) and fixed, functionality is back in! :)
Could not delete files from the list (in the advanced page) which did not exist on the drive. (Thanks to Matthew Ellis for finding the bug) This is now fixed.
When navigating code using the browse facility, the add-in would remove the highlighted piece of code, regardless of whether there was a bookmark set for that file or not. (Thanks to Matthew Ellis for the suggestion)
Fixed a real nasty bug, that had been around from day 1 (sorry people). A lot of people experienced this bug and now it's finally fixed. The bug was that, after opening a file from the advanced tab and then trying to shut down DevStudio (V5 or V6), DevStudio wouldn't shut down properly.
Thanks to Jeff Rockwell for bugging me from day 1 to track it down and Itay Szekely who recently brought it to my attention.
Again, I am really sorry this has been around for so long and only just fixed, but I RARELY spend time on this add-in.
Bruce Mack suggested that I show the text the bookmark is actually is set to
in the advanced tab (see screen shot above). The new version will (should)
read your all saved bookmarks file correctly. The first time that you run
this, you may not see the selected text in the tree control. The tree
control will get updated as and when files are opened/closed with the new
add-in.
There is one problem (actually it's a minor annoyance). Every time, the user hits save, the editor will scroll. The cursor will remain at the same place but the text scrolls (which can sometimes dis-orient users). There doesn't seem to be any good way of achieving this. :-
This add-in has been tested under Windows 95/NT and works for VC5. It has also been tested under Windows 95/NT running VC6 and it seems to be running. If however you have a problem please let me know.
Thanks to everyone for using this add-in and for the time taken to e-mail me with useful comments and suggestions.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||