Author Topic: Bookmark Problems in Brief Mode  (Read 7392 times)

dlsheeks

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Bookmark Problems in Brief Mode
« on: October 07, 2007, 03:07:13 PM »
When using bookmarks in Brief emulation mode, the bookmark list invoked with alt-j (set-bookmark) gets "confused" and won't allow bookmarks to be deleted. Various other bookmark behavior in Brief mode appears to have changed in SlickEdit 7, including the shortcut keys to return to a bookmark set via alt-# (where # is 0..9). The bookmarks can be set using alt-#, but returning via ctrl-# doesn't work. You can return to a bookmark via Ctrl-Shift-#, although that requires a less a more complicated effort. Does anyone else still use Brief mode, and if so have you seen similar issues?

StephenW

  • Senior Community Member
  • Posts: 197
  • Hero Points: 21
Re: Bookmark Problems in Brief Mode
« Reply #1 on: October 07, 2007, 08:46:39 PM »
I use Alt-J and Alt-# all the time, but not Ctrl-#.  I have always used Alt-J # <Enter> to jump to bookmarks - that way I get to see the bookmark I am jumping to before I go there.  When I tried it, Ctrl-# did the same as Alt-#.  So I checked the key bindings, and Ctrl-# is bound to alt-bookmark, exactly the same as Alt-#.  Ctrl-Shift-# is bound to alt-gtbookmark, so if you want Ctrl-# to work like Ctrl-Shift-#, you will need to rebind all the Ctrl-# keys to alt-gtbookmark.

I wonder why this was done - it seems a big waste to have all the Ctrl-# keys bound to exactly the same as the Alt-# keys.

hs2

  • Senior Community Member
  • Posts: 2763
  • Hero Points: 292
Re: Bookmark Problems in Brief Mode
« Reply #2 on: October 07, 2007, 09:22:46 PM »
@dlsheeks: Als StephenW proposed you need to rebind 'alt_(gt)bookmark'. This can be easily done by using this sample macro code
Code: [Select]
def  'C-0'-'C-9'= alt_gtbookmark;
def  'A-0'-'A-9'= alt_bookmark;
in your 'vusrdefs.e'. You can remove/'#if 0' after loading it.

I patched/fixed 'bookmark.e' b/c I'm also still using the legacy 'sb' command and it has a few problems at least since v12.0.3. Can't remember if earlier versions are also affected.
The fixed 'bookmark.e' also contains a sneak preview version of save/restore bookmarks as posted by Clark himself. (http://community.slickedit.com/index.php?topic=2049.msg8641#msg8641).
However, DEL works fine again (and add. also in 'gb' == goto-bookmark) :)
Additionally I changed sth. related to the whitespace handling in the combo box and the focus is always forced to the list and e.g. switches imm. back to it even when using 'ALT-D == Delete button'. (I just find it useful if I'm still able to navigate in the list even after using button accelerator.)
The (hopefully all) changes are marked with '// HS2-...' if you want to change the changes.

Have fun,
HS2
« Last Edit: October 07, 2007, 09:34:34 PM by hs2 »

microcode

  • Community Member
  • Posts: 59
  • Hero Points: 10
Re: Bookmark Problems in Brief Mode
« Reply #3 on: October 18, 2007, 09:41:44 PM »
When using bookmarks in Brief emulation mode, the bookmark list invoked with alt-j (set-bookmark) gets "confused" and won't allow bookmarks to be deleted.

I use BRIEF mode also, and I've run into this problem as well as another one.

I found that after hitting Alt-J you can't delete a bookmark if you navigate through the list, but you can delete a bookmark if you type the number into the comob box and click on the Delete button (or press Alt-D).  I wonder if it's getting confused because of the underscore characters that are apparently inserted between the bookmark number and the filename when an entry gets copied from the list to the combo box?

I haven't yet tried HS2's patch to bookmark.e so maybe that is what he fixed.



The other problem that I ran into is that I can't immediately jump to a bookmark using the Alt-J <number> <Enter> keystrokes that I'm used to.  Hitting Alt-J brings up the bookmark list and then typing in the number highlights the bookmark that I want.  So far so good.  But when I hit <Enter>, SlickEdit moves the bookmark to the current line rather than taking me to the previously saved location.  A co-worker pointed out that it's because the default button in the bookmark dialog box is the "Add" button and not the "Go To" button.  In an older version of SlickEdit (version 10 something) the "Go To" button was the default, so apparently this was changed somewhere between that version and version 12.0.3 which I'm using now.  Is this default button something I can change in bookmark.e?

hs2

  • Senior Community Member
  • Posts: 2763
  • Hero Points: 292
Re: Bookmark Problems in Brief Mode
« Reply #4 on: October 18, 2007, 10:02:53 PM »
@microcode: The 1st part of the problems should be fixed by the patch. Note the improved keyboard support by supporting the DEL key in both dialogs ('sb' and 'gb').

Concerning your 2nd issue I'd propose to bind 'goto-bookmark' to ALT-J or if you want to use 'sb' to goto bookmarks most of the time you could patch the patch ;)
bookmark.e - _set_bookmark_callback() [line 198]:
Code: [Select]
            _sellistok.p_default=0;
            ctlgoto.p_default=1;

Have fun,
HS2
« Last Edit: October 18, 2007, 10:09:06 PM by hs2 »

microcode

  • Community Member
  • Posts: 59
  • Hero Points: 10
Re: Bookmark Problems in Brief Mode
« Reply #5 on: October 18, 2007, 10:57:19 PM »
@hs2: Changing the Alt-J key binding from 'set-bookmark' to 'goto-bookmark' fixed the issue for me.  Thanks!

The 'goto-bookmark' displays a different dialog box that has a "Go to Bookmark" button as the default, so pressing <Enter> jumps to the selected bookmark just like I'm used to.