Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Open file paths in focused window - #3355

Merged
kevinsawicki merged 11 commits into
masterfrom
ks-open-files-in-current-window
Aug 25, 2014
Merged

kevinsawicki merged 11 commits into
masterfrom
ks-open-files-in-current-window

Conversation

@kevinsawicki

Copy link
Copy Markdown
Contributor

Summary

Instead of opening file paths in a new window based on the file's parent directory, open file paths in the current window.

Also open folders in the current window when the current window doesn't already have a project path. This will affect untitled windows that were launched from the dock or by pressing cmd-shift-N.

You can still always force a new window from the command line by running atom -n package.json or atom --new-window package.json.

Multi-folder project support is still planned though via #770.

File behavior changes

Files opened using the atom command open in the currently focused window

file-cli

Dropping a file onto a window opens it in that window

file-drop

Selecting a file from the path chooser (cmd-o) opens that path in the current window

file-open

Files dropped on the Mac OS X dock icon will open in the last focused window

file-dock

Folder behavior changes

Folders opened using the atom command will open in the currently focused window if it doesn't already have a project path

folder-cli

Dropping a folder onto an untitled window sets that window's project path to the dropped folder's path

folder-drop

Selecting a folder from the path chooser (cmd-o) opens that folder in the current window if it doesn't already have a project path

folder-open

Closes #1722

@benogle

benogle commented Aug 22, 2014

Copy link
Copy Markdown
Contributor

People's heads are going to explode

@benogle

benogle commented Aug 22, 2014

Copy link
Copy Markdown
Contributor

💥

@batjko

batjko commented Aug 22, 2014

Copy link
Copy Markdown
Contributor

Ha, indeed! It's been one of those "I'm not going to switch to Atom until..." kind of requests.
Thanks 👍

@yongkangchen

Copy link
Copy Markdown

💥 +1

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

@F0x06 which commit did you build against?

@m1ga

m1ga commented Aug 22, 2014

Copy link
Copy Markdown

How does it behave when you start atom and then opening a folder? Will it open it in the current "unused" window? As far as I understood "Folder behavior changes" it will open a second window, right?

@lee-dohm

Copy link
Copy Markdown
Contributor

💥

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

How does it behave when you start atom and then opening a folder? Will it open it in the current "unused" window? As far as I understood "Folder behavior changes" it will open a second window, right?

Thanks for bringing this up, I think it might make sense to change this now in this PR, so that when you open a folder from an untitled window, it reuses the untitled window instead of opening a second window.

@SjoerdPennings

Copy link
Copy Markdown

👍
I hope this will be merged.

@F0x06

F0x06 commented Aug 22, 2014

Copy link
Copy Markdown

@kevinsawicki
All is working fine, sorry its me forgot to checkout to correct branch.

Good work!

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

Okay, I have made some folder behavior changes, untitled windows are now reused when opening a folder path.

Please see the details and GIFs in the updated issue body.

@batjko

batjko commented Aug 22, 2014

Copy link
Copy Markdown
Contributor

Thanks for including opening a folder with this change! It really wouldn't have made sense without it.

Suddenly, I can't wait for #770, though.

@m1ga

m1ga commented Aug 22, 2014

Copy link
Copy Markdown

Thanks for bringing this up, I think it might make sense to change this now in this PR, so that when you open a folder from an untitled window, it reuses the untitled window instead of opening a second window.

awesome! Thanks for updating untitled windows behavior!

@i4004

i4004 commented Aug 23, 2014

Copy link
Copy Markdown

When I am opening a new file in an existing window, then the window docking is changing.
screen

@nshtg

nshtg commented Aug 23, 2014

Copy link
Copy Markdown

👏 Finally!

Do I understand it correctly: I have a project open and I use atom test.coffee in another folder -> it will open it in the active window anyway?

@F0x06

F0x06 commented Aug 23, 2014

Copy link
Copy Markdown

@maschs

Yes :)

@philipgiuliani

Copy link
Copy Markdown
Contributor

Amaaziiing!! :) great work!

@jasonhansel

Copy link
Copy Markdown

👍

@zekesonxx

Copy link
Copy Markdown

👍 this is the thing I need to switch to Atom.

@kevinsawicki
kevinsawicki force-pushed the ks-open-files-in-current-window branch from 1abdbcb to fb53f85 Compare August 25, 2014 16:21
This ensures the window where the file is dropped is used to open
that file into even when that window does not have focus.
Untitled windows will now have their project path set when a folder
is opened.
@ferdynice

Copy link
Copy Markdown

sweet

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

@laktak Would you mind opening up a new issue for that? thanks

@gi4nks

gi4nks commented Aug 28, 2014

Copy link
Copy Markdown

Thanks :)

@rayman22201

Copy link
Copy Markdown

This pull request has changed my life. @kevinsawicki and any other devs who worked on this, I can't contain my love for you right now. 💥 ❤️

@benogle

benogle commented Aug 29, 2014

Copy link
Copy Markdown
Contributor

☝️ This dude's heart exploded!

@Nicolab

Nicolab commented Aug 29, 2014

Copy link
Copy Markdown

😄

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

@rayman22201 Thanks for the feedback, always appreciated 🌞

@kevinsawicki

Copy link
Copy Markdown
Contributor Author

This is works very well on the Mac but on Windows Atom stays in the background.

@laktak This was fixed by 78f7ff6 and will be included in the next release, 0.125

@laktak

laktak commented Sep 1, 2014

Copy link
Copy Markdown

@kevinsawicki great, thanks!

@dfa1234

dfa1234 commented Sep 2, 2014

Copy link
Copy Markdown

take no offence but, I NEED TO come back to the previous behaviour !!!! there is a option ins the preferences of any way?

1- when i open a file from a project I want to open this project
2- when i open another file from another projet, i need a new windows of this new project

I dont want this new mixed salad

(from the finder and / or cyberduck -- not terminal)

@benogle

benogle commented Sep 2, 2014

Copy link
Copy Markdown
Contributor

@dfaure1 You can open a folder if you would like a new window.

@dfa1234

dfa1234 commented Sep 3, 2014

Copy link
Copy Markdown

that seem to resolve my issue, thank a lot!

@netmou

netmou commented Sep 5, 2014

Copy link
Copy Markdown

i wish that when atom start,it can open the last opened folder or when i open a folder in a new window ,it can open the tree-view automatically , and close the untitled file ,maybe coffee script can do that,but i don't know how to do it, maybe that is a bug

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open file in current window