Repository navigation
Conversation
|
Thanks @jingchan, could you write some specs to cover this change. I may be alone, but I consider not closing the window with |
|
I agree with @probablycorey. I like that I can mash core close and not On Tuesday, May 27, 2014, Corey Johnson [email protected] wrote:
|
|
Sure, I'll look into specs and a flag.. I'm not very familiar with this code so any tips would be appreciated =) |
|
@jingchan Sure thing! To add a new config option, take a look at this snippet. For some related specs, see this snippet for the core:close event which closes a pane, and this one for the window:close event which closes a window. |
|
The more I think about this, the less I like it. I dont think any of our commands should have different behavior based on state. IMO, this should be a package. If this does end up in core, I think it's in the wrong place. |
|
I kind of agree with @benogle on this one as far as the commands underlying the keymaps go. Emacs seems to have a tradition of more complex commands having more complex names such as I think following this composition model though is the better path than making commands with simple names more complex (and thereby making their names deceptive). |
|
I agree with @lee-dohm and @benogle now, we shouldn't add this functionality to core. We could create a |
|
After investigating behavior in other editors (i.e. SublimeText 3), it seems that Only for an empty final window, does Either way, I'd be okay with this being in the trunk or package or wherever (just let me know), as long as I can have it mimic the behavior of ST and TM. (old habits die hard =) @benogle ctrl-w actually already does more than just close tab because it will close a pane if that pane has only has one tab remaining. I don't have easy access to the code right now, but you will see this logic in the workspace_view code that calls the modified function (I didn't think the edit belonged there, either.). So I would submit that consistency depends on whether users typically perceive an editor window as a pane or as something else =). @probablycorey That package closes the last tab along with the last tab, rather than after it. I was unaware of how to create a package to achieve that, as I couldn't find an appropriate hook. That's what led to this patch. (See discussion about that package at #863 ) |
|
@jingchan I don't think that there really is disagreement over "expected behavior". I think we all agree that your desire for this feature is valid and we want you to have exactly the feature you want. The discussion happening is about the design of the commands underlying the key combinations that you want to perform this operation. And you may well be right that there are already instances of inconsistency in behavior ... but they should be fixed when they're found too 😄 |
|
@lee-dohm Thanks for the clarification. I was short on time with my last response, but I see that now. Also, the word 'disagreement' maybe came across stronger than intended. =) I agree that both features should be available. It appears the default behavior in Sublime Text on Windows never closes the window (current behavior), while the default behavior on Mac only closes the window if others are available (proposed above). So it seems the defaults are OS-specific in ST's case. Related Question: Has it been a priority for Atom to closely mimic behavior in other editors? |
That's a complicated question. But I'll try to answer it from a couple different perspectives:
I feel the same way about Atom ... it should be a high-level language that people like you use to build their dream editor with, whether that closely mimics the behavior of other editors or not. |
|
Since we have second-thoughts about adding this to Atom core, and since there already is a package that provides this functionality -- should we close this PR? Personally, I'm also leaning towards that option. /cc @probablycorey @benogle To help users find packages which provide functionality that commonly comes built-in with editors -- we could make a list of such packages and link to it from the docs and in the Welcome screen (?). |
|
@izuzak as discussed above and in the referenced issue, that package does not provide the feature being discussed. |
|
It is also discussed on that packages repo here: JRHeaton/atom-close-after-last-tab#2 (Sorry for new comment, can't edit on phone) |
@jingchan Thanks for pointing that out, I did miss that discussion. However, I'm not sure everyone agrees on what the feature being discussed is (should the window close always, or only if there is another window open? should the window close with the last tab or after it, requiring another cmd-w keystroke? should it completely mimic an existing editor or not?). And even if there was agreement, it seems that there are concerns about adding this functionality into Atom core. How do you feel about creating a new package for this, which implements this feature in the way you expect it to work, or with configuration options to cover the possibilities mentioned above? |
|
@izuzak Not a problem. I'll close this. I didn't realize the existing behavior would be preferable to some, but since that is the case, it probably shouldn't be in core. I wouldn't mind writing a package for this (when I find the time), but I believe some new events need to be emitted for that to be possible. However, as a UI/UX guy, I would recommend a sublime-like "close if no tabs" functionality as default, simply because it covers more typical end-user use-cases with less keys. It's lessens the learning/thinking burden. But that is up to you guys to decide =). |
|
Sorry if my comments sounded like my goal was to close this PR (it wasn't). I agree that having this functionality would be useful, but it seems that this PR wasn't moving forward. My intention was to push things forward, so that you get some feedback and so that this functionality becomes available to users. At the moment, it seems that there are concerns to adding this to Atom core, so the best/fastest way to make this happen is to create a new package (or contribute to an existing one).
Could you clarify which events would need to be added? I think that listening for |
|
I think for now, a package is the right way forward 👍 I agree with @izuzak that likely nothing will need to be added to support this. If you get into it, and you need something, ping us :) |
Fixes #863