Sublime Forum

Remember cursor position on file reload

#1

I frequently switch between branches in git, and when I switch back to ST2, it conveniently reloads any affected files. However, ST2 places the cursor at the top of the file, whereas TextMate maintains the cursor’s line position. Obviously, TextMate’s behavior isn’t perfect when the number of lines between file versions differs greatly, but I still prefer it to being swept back up to the top of the file.

Would it be possible to implement this behavior in ST2?

EDIT: I started poking around in the BufferScroll plugin to see if this could be accomplished with a plugin, but it appears that ST2’s API doesn’t have a listener for the file reload event: sublimetext.com/docs/2/api_r … ntListener.

0 Likes

#2

Ah, just found and voted for this feature on UserEcho: sublimetext.userecho.com/topic/5 … le-change/

0 Likes