Author Topic: Bookmark at end of first line in a file scrolls the window  (Read 2374 times)

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Bookmark at end of first line in a file scrolls the window
« on: September 01, 2014, 12:42:41 PM »
I'm trying to test the ability of a workspace to remember bookmarks correctly and noticed this.  Don't know if you'll be able to reproduce this but it's reproducible for me.  If I have a bookmark at the end of the first non blank line in a file and the line is longer than around 23 characters, when slick goes to the bookmark (e.g. with next-bookmark) it scrolls the window horizontally so that the first visible column is now something like col 24 or whatever.  A horizontal scrollbar pops up, full scrolled to the right.  Only seems to happen for the first non blank line.

Code: [Select]
/******************************************************************************
*

Well now with some more testing, after deleting a few characters and setting a bookmark halfway along the line, the problem stopped happening on that line, so I created a new first line  - and now the problem is on the second line (which used to be the first line).

Just noticed another problem  - I have about 16 bookmarks in this workspace.  If I'm on the above two lines and do next-bookmark 3 or 4 times, then prev-bookmark 3 or 4 times, I would expect to get back where I started.  But I don't - it goes diving off somewhere else.

Clark

  • Moderator
  • Senior Community Member
  • *
  • Posts: 6875
  • Hero Points: 530
Re: Bookmark at end of first line in a file scrolls the window
« Reply #1 on: September 01, 2014, 03:28:21 PM »
I couldn't reproduce the scrolling issue but I'll keep trying.

The next/prev bookmark commands appear to sort locations within the current file. Once it goes to another file, then it seems to do a _next_buffer('rh') instead of checking which direction was chosen. Here's the Slick-C fix:

Code: [Select]
      if( !def_vcpp_bookmark ) {
         // Look in other buffers for the next/prev bookmark
         for (;;) {
            if (direction=='+') {  // Added
               _next_buffer('rh');
            } else {                    // Added
               _prev_buffer('rh'); // Added
            }                             // Added
            if (hashtab._indexin(p_buf_id)) {
               break;
            }
            if (p_buf_id==orig_buf_id) {
               break;
            }
         }
      }

This is fixed in the next beta.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Bookmark at end of first line in a file scrolls the window
« Reply #2 on: September 02, 2014, 01:20:52 AM »
ok, I'm testing with an un-configured setup except for my files toolwindow.  i.e I have a "blank" configuration with all default settings, including cancelling out of the "quick setup" thing you get the very first time.  I might try the slick c debugger on this.