Sublime Forum

How do I stop automatic horizontal scrolling when selecting to a shorter line?


Here’s a video of what I’m talking about:

Whenever I’m trying to select text on a line that’s much longer than the surrounding ones, I’ll often accidentally move my cursor too far up/down, and the view scrolls all the way back to the left. Is there a way to stop this from happening? Basically, I want to disable horizontal scrolling while I’m actively making a selection.

I’ve made some of my own plugins and wouldn’t mind coding it, but I honestly can’t figure out a way to do it.

1 Like


this is something that has often annoyed me too when selecting long lines using the mouse. I think I normally just turn on word-wrap temporarily, make my selection and continue - or use the keyboard instead of the mouse when I get frustrated.

I’m not sure it’s very possible with a plugin, there are no scroll events that could be listened to so one could cancel it or reset the position to what it was when the mouse selection was started… The only thing I can think of would be to pad the line above and below with spaces when starting a mouse selection, but that will affect undo history etc. so seems like an ugly solution to me. I’m curious to see what ideas other people will mention :slight_smile:

1 Like