Sublime Forum

Сlick outside view on minimap jumps in wrong file position


Screenshot on the left — before click, on the right — after ckick.

This occurs in 99% of similar cases :frowning:


Minimap left click

true… something with the last change in the minimap look/behavior i guess…



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:

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:

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.



Oh, it’s a tricky a little, but I now understand this situation.

But in the today situation in minimap action after click in long files is very not intuitive.

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.

And maybe teleport cursor is not necessary, no?



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 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.[/quote]

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.



Yeah, ran out of time for it - will look at including it in the next beta.



i like the change even as it is, i use the ‘text’ mode. mouse teleport could be nice to have.



I tried ‘text’ and it is for me. Thank you! :smiley:



Text mode is awesome, but I’ll suggest one more tweak:
When clicking outside the view rectangle and holding the mouse button down, the view rectangle moves to the location of the click, but it doesn’t continue to follow the mouse while the button is held down. As a result, if I want to jump to a location, and then make fine adjustments, I have to Click-Release-ClickAndHold-Adjust. If this could be changed to simply ClickAndHold-Adjust, that would be perfect.
I realize this is an issue with the way the MiniMap scrolls on large files, but perhaps this could be solved by changing the way the MiniMap scrolls in this mode - Have it not scroll until you move the view rectangle near the edge, similar to how scrolling works when selecting text in the document.



while were resurrecting old threads… text definitely is the more intuitive one for me. Teleporting the cursor would be the way to go. If i remember correctly, a few apps do the whole cursor teleport deal (ps, 3dmax)



This subject is actual again in the ST2 :wink:



+1 for this option in ST2

Vote for it here: … -position/




Related: I think it is more intuitive that the view box be centered around the mouse click. Currently, the top of the view box is placed at the mouse-click location. It is hard for me to re-train my mind to click slightly above the region of interest, so that the ROI is centered in my window.