Author Topic: Disable auto pushing a bookmark on the stack when I go to a named bookmark  (Read 7846 times)

mako

  • Community Member
  • Posts: 28
  • Hero Points: 1
Whenever I use the Go to Bookmark dialog to jump to a named bookmark, Slickedit automatically pushes my current location on the bookmark stack. There does not appear to be any way to disable the auto-push, but it is almost never what I want. I end up with lots of bookmarks on the stack that obscure the ones I put there intentionally.

I've used Slickedit for many years, and it didn't always do this, though I don't remember which version introduced the undesirable behavior.

BTW, why does the forum message editor flag "Slickedit" as a misspelled word?

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
In the Tools|Options dialog, what is the value for Editing > Bookmarks > "Navigating search results pushes bookmark"?  That's what I'd expect to control this behavior.

mako

  • Community Member
  • Posts: 28
  • Hero Points: 1
In the Tools|Options dialog, what is the value for Editing > Bookmarks > "Navigating search results pushes bookmark"?  That's what I'd expect to control this behavior.
Nope. I have that disabled. I assume that option refers to traversing the results of a Find operation.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
If you use the bookmarks tool window to go to a bookmark you won't get a pushed bookmark.  You can also delete all pushed bookmarks with the command pop-all-bookmarks.

If you feel like hacking the slickedit macro code you could comment out the call to push_bookmark() in the code below.  Type fp goto-bookmark on the slick command line to go to the function.  Look for the following code in that function. Comment out the call to push-bookmark then recompile using the load module command on the macro menu.

Code: [Select]
   // only push a bookmark if they selected one from the dialog
   // otherwise, assume that the caller will decide if we should
   // push a bookmark or not.  If we push a bookmark, it may cause
   // the bookmark ID's to get shuffled, so we need to find the
   // bookmark ID again so we go to the right place.
   if (bookmarkName == '') {
      _BookmarkGetInfo(bm_id, bookmarkName);
      push_bookmark();
      bm_id = _BookmarkFind(bookmarkName);
      if (bm_id < 0) {
         bm_id = _BookmarkFind(bookmarkName,VSBMFLAG_PUSHED);
      }
   }

mako

  • Community Member
  • Posts: 28
  • Hero Points: 1
If you use the bookmarks tool window to go to a bookmark you won't get a pushed bookmark.
That's interesting, but not useful for me. I don't want to take my hands off the keyboard when navigating tags and bookmarks. The Go to Bookmarks dialog is better for this because it pops up only when I need it and can be easily navigated with the keyboard. It seems unintuitive that these two ways of choosing a bookmark to jump to will yield different behaviors for the pushed-bookmark stack.
  You can also delete all pushed bookmarks with the command pop-all-bookmarks.
I've seen this suggested elsewhere, but it entirely misses the point. I like using pushed bookmarks, I just want to control when they get created so that when I pop them I know where I'll end up. If I have to wipe them all out in order to get that control they lose all their usefulness.

If you feel like hacking the slickedit macro code you could comment out the call to push_bookmark() in the code below...
Thanks! I'll give this a shot.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Quote
That's interesting, but not useful for me. I don't want to take my hands off the keyboard when navigating tags and bookmarks. The Go to Bookmarks dialog is better for this because it pops up only when I need it and can be easily navigated with the keyboard.

You can use the bookmarks toolwindow like that too.  You can pop the window up with the activate-bookmarks command.  To get the window to close when you select a bookmark, you need to right click on the tool window title bar and select customise - then select appearance -> tool windows and select the bookmarks tool window.  In the right hand pane, enable "ESC dismisses floating window".

With the bookmarks toolwindow, you can have the preview toolwindow showing you the code where that bookmark is,

Quote
I've seen this suggested elsewhere, but it entirely misses the point.
 
I didn't miss the point.  I was trying to give you information.

If you change slick macro code, you need to watch out for the fact that the bookmark.e module might be changed by a slickedit hotfix which will blow away any changes you have made.

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
I'm putting in a hot fix for 16.0.3 to address this.  The option that was suggested for not pushing bookmarks when navigating to search results will now also prevent a bookmark from being pushed when you navigate to a bookmark.

Another suggestion.  If you don't like the pushed bookmarks (blue) hiding your real bookmarks (green), you can turn off the option to display pushed bookmarks in the editor.  Tools > Options > Editing > Bookmarks > Show pushed bookmarks (False)

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Another suggestion.  If you don't like the pushed bookmarks (blue) hiding your real bookmarks (green), you can turn off the option to display pushed bookmarks in the editor.  Tools > Options > Editing > Bookmarks > Show pushed bookmarks (False)
@Dennis - I don't know how feasible this is, but could the editor's rendering engine prioritize painting real bookmarks later than pushed bookmarks, so that pushed bookmarks never obscure explicit manual bookmarks?

mako

  • Community Member
  • Posts: 28
  • Hero Points: 1
Quote
I'm putting in a hot fix for 16.0.3 to address this.  The option that was suggested for not pushing bookmarks when navigating to search results will now also prevent a bookmark from being pushed when you navigate to a bookmark.

Great! Another action that pushes bookmarks automatically (with no way to disable it) is using the "Tags in current file" dialog to jump to a function in the current buffer. This also seems like a natural to be controlled by the "don't push book marks when navigating search results" option.

I'm not so concerned about the pushed bookmarks obscuring the named bookmarks in the left margin, though it would be nice if the named bookmarks took precedence in the display, as chrisant suggests.

Dennis

  • Senior Community Member
  • Posts: 3960
  • Hero Points: 517
I can fix that for the next release too.  At first, I thought maybe it should be a separate option, but it's reasonable to place it under the same umbrella.  I can't imagine someone having one enabled and the other disabled if it were two options.

mako

  • Community Member
  • Posts: 28
  • Hero Points: 1
Re: Disable auto pushing a bookmark on the stack when I go to a named bookmark
« Reply #10 on: February 01, 2012, 12:16:18 AM »
I've installed the latest hotfix and tried out the changes. Thanks for getting this fixed so promptly. :)