Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No focus when switching projects #104

Open
jpmvferreira opened this issue Aug 21, 2019 · 1 comment
Open

No focus when switching projects #104

jpmvferreira opened this issue Aug 21, 2019 · 1 comment

Comments

@jpmvferreira
Copy link

jpmvferreira commented Aug 21, 2019

Hi there,

I've noticed a small issue in the way the package behaves when switching projects (i wouldn't call it a bug), but whenever i switch from a project to another, not only the tree-view expands (which might be intended) but there is no focus on either the editor nor the editor, which is annoying when you are in a keyboard-driven system.

Because of that, i'm here to suggest a few features (customizable if possible) i haven't seen being suggested:

  • Atom gains focus on edito or the tree-view when switching projects
  • Tree-view not expanding upon switching projects

Personally for me the first one is the most important one, has i can close the tree-view with shortcut, but right after switching project my first instinct is to start typing or changing tabs, only to find out that there is no focus on either editor or tree-view, so i must use Alt+/ to gain focus on tree-view, and use it again when switching focus to editor.

This isn't game breaking, it's just something that would add a little convenience and probably didn't deserve such an extensive thread.

I also noticed this issue - sorry i don't know how to redirect issues - that claims to have fixed this losing focus behavior, but i still have it.

System Specs:

  • Manjaro (stable)
  • Kernel 4.19 (latest)
  • Atom 1.39 (latest)
@jpmvferreira
Copy link
Author

I'm trying to create a workaround for this issue, and i begin by writing my own custom keybind with the set of actions that can be used to regain focus on the editor after switching projects, however it's not working as expected, here's the init.js:

atom.commands.add('.platform-linux', 'custom:get-focus', function() {
  atom.commands.dispatch(atom.workspace.element, 'tree-view:toggle');
  atom.commands.dispatch(atom.workspace.element, 'tree-view:toggle');
  atom.commands.dispatch(atom.workspace.element, 'tree-view:toggle');
  atom.commands.dispatch(atom.workspace.element, 'tree-view:toggle-focus');
  })

I've tried several combinations of tree-view:toggle and tree-view:toggle-focus and none of them work.

If anybody could give me a hand here it would be really great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant