This is mostly unavoidable on any file where the minimap doesn't show the whole file. It's been discussed a couple of times previously on the forums, I'll try to explain the issue a bit better here.

If you rely only on dragging the view rectangle around, then everything's fine. Once click-to-scroll is used, there are two reasonable options: take the user to the text they clicked on in the minimap, or take them to the % position (i.e, click 1/4 of the way down the minimap, and you'll be taken to 1/4 of the way through the file). Sublime Text does the second option, because the first, while it sounds better, is very disconcerting - it would end up with the view rectangle not going to where you click. Let me explain, firstly, take a look at:

pre-click.png (128.35 KiB) Viewed 2775 times

Imagine this is the current screen, and you want to go to where the mouse cursor is, drawn in blue.

After clicking, the window will look like:

post-click.png (128.27 KiB) Viewed 2772 times

Here you can see that you have been taken to the correct position (note all the ===== signs), but the orange view rectangle is nowhere near the mouse, which is still up at the blue point. This is because the translation of the minimap depends on the translation of the view.

The best compromise may be to take you to the text you click on, but teleport the mouse cursor so it lines up with the new position of the viewport. This still isn't great, but may be more popular than my preference to simply disable clicking on the minimap, and only allow the orange view rectangle to be dragged around.

Move view to desired text position without sinchronization with mouse cursor — this is the least evil. It has at least some sense and logical explanation for what is happening.

i too think the mouse cursor may not be synced. i can't tell before trying, but it seems the current implementation is not so intuitive.

I agree. The current implementation, while logical, is not useful at all. I only click-to-scroll for small files; for larger files, I drag the rectangle, because clicking sends me to hyperspace and makes me lose track of what I'm doing.

In 20091010, what happens when clicking outside the view rectangle can now be configured. By default, it does nothing. To change this, edit the file type options and set 'clickToScroll' to either 'position' (the old behaviour), or 'text', to scroll the view to the clicked on text. I'd like to hear what everyone thinks about the text mode.

jps wrote:In 20091010, what happens when clicking outside the view rectangle can now be configured. By default, it does nothing. To change this, edit the file type options and set 'clickToScroll' to either 'position' (the old behaviour), or 'text', to scroll the view to the clicked on text. I'd like to hear what everyone thinks about the text mode.