Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

add option for click to focus editor#617

Closed
jacekkopecky wants to merge 1 commit intoatom:masterfrom
jacekkopecky:click-through
Closed

add option for click to focus editor#617
jacekkopecky wants to merge 1 commit intoatom:masterfrom
jacekkopecky:click-through

Conversation

@jacekkopecky
Copy link
Copy Markdown

Often I use the mouse to navigate between files – I point to the file, click on it, look at it, and expect to be editing it but the focus is on tree-view. This PR adds an option that a single click on a file focuses the new text editor.

Comments welcome – would others like this option?

@jacekkopecky
Copy link
Copy Markdown
Author

Any comments, please?

@ewoutp
Copy link
Copy Markdown

ewoutp commented Feb 4, 2016

This is exactly what I'm looking for.

@jacekkopecky
Copy link
Copy Markdown
Author

Updated to v208, don't understand why appveyor build failed.
Please comment.

@winstliu
Copy link
Copy Markdown
Contributor

winstliu commented Jul 15, 2016

AppVeyor was prematurely activated on tree-view, which doesn't have Windows spec compatibility yet.

@atom/feedback any comments? Maybe a spec?

@bronson
Copy link
Copy Markdown

bronson commented Oct 19, 2016

I love this PR except I think it should be the default behavior. No need for an option.

It appears ternjs is giving me this functionality: tststs/atom-ternjs#264 (?!) So that's an easy fix until this PR is merged.

@BinaryMuse
Copy link
Copy Markdown

Thank you for the PR, @jacekkopecky!

@bronson, #749 is proof that not everyone agrees with that workflow. ;) We won't be changing the default behavior again.

As for the option, #749 and @lee-dohm's comments in #804 explain why we're loathe to add yet more options that modify the behavior of opening items from the tree view.

If you would like to focus the editor when it's opened via single-click from the tree view, you have a few options currently:

  • Double-click the entry, which opens the file as a permanent item instead of a pending item

  • Use a package like single-click-open

  • Add a bit of glue code to your init.coffee:

    atom.workspace.onDidAddPaneItem ({item, pane}) ->
      pane.setPendingItem(null)
      process.nextTick () => atom.views.getView(item).focus()

@BinaryMuse BinaryMuse closed this Oct 20, 2016
@bronson
Copy link
Copy Markdown

bronson commented Oct 20, 2016

That makes sense, thanks for the fantastic explanation @BinaryMuse!

@jacekkopecky
Copy link
Copy Markdown
Author

Thank you, yes, single-click-open does the trick.

@bronson
Copy link
Copy Markdown

bronson commented Oct 20, 2016

Sadly, not for me: MiracleBlue/atom-single-click-open#3

Hope the maintainer comes back soon.

Good to see you @jacekkopecky

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants