Sublime Forum

Opening already open file on mac, ST4 vs 3

#1

In ST3 on mac, when I opened a file that is already open (via finder or command line open), it brought the relevant window/tab to the foreground as-is – no scrolling etc. In ST4, the correct window comes to the foreground, but the position in the file resets to the top. Is there a way to restore the ST3 behavior?

(For command line, which is my main use case here, I did notice that subl still seems to have the behavior I want; though I’d really much rather just use open, since it is more general than just files that open in ST and is already in the default path.)

0 Likes

#2

I can’t reproduce this. Does it happen in safe mode?

0 Likes

#3

Thanks for looking into this; I just tried it out in safe mode and I’m seeing the same behavior. Since it sounds like this may be more of a bug report than help request, here’s what I’m doing more exactly, starting from a newly opened safe mode instance:

  1. open a file in ST4 in any way. I’ve tried a few file types (.cc, .py, .md), let’s say I’m opening a file called “README.md” that ST4 is the default editor for.
  2. scroll down in that file, either placing the cursor or not
  3. in a terminal window from the correct directory, do: open README.md. The window comes to the foreground but scrolls to the top. (This command assumes ST4 is the default editor for that file type, which it is for me for these file types – but the behavior is the same if I explicitly use open -a /Applications/Sublime\ Text.app README.md.)

This is an M1 mac mini still on Big Sur (specifically 11.6.5, I realize that’s a bit behind :sweat_smile:), ST4 stable build 4126. I don’t think there’s anything very unusual about how I have ST4 installed (except maybe that I also still have ST3 installed separately). I only recently fully migrated from ST3 so I was comparing on the exact same device / OS, to ST3 build 3211.

0 Likes

#4

Do you get the same behaviour if you subl README.md isntead of open README.md? (this requires you to have set up the command line interface if you haven’t already.

0 Likes

#5

No, subl does what I want and opens the tab without scrolling (that’s what the last paragraph in my post was alluding to). Not sure it matters but I just tried it out in safe mode (/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --safe-mode README.md) and it seems to work ok too.

0 Likes

#6

Ahh sorry, my bad, I missed that part in the original post.

0 Likes

#7

We’ve got a fix for this in the pipeline

0 Likes

#8

Awesome, thanks!!

0 Likes