olmokramer / atom-autohide-tree-view

Hides most of the tree view, reveal it on hover
MIT License
38 stars 7 forks source link

export toggle-focus #45

Closed xcv58 closed 9 years ago

xcv58 commented 9 years ago

The original tree-view has a function: tree-view:toggle-focus.

The mouse hover is very good, but sometimes I don't like move mouse.

So I try to add similiar feature, but there's a bug in your codes. The toggle() in autohide-tree-view.js doesn't work, because the isVisible() always return false.

olmokramer commented 9 years ago

Hi, thanks for the PR! I'm currently on vacation, but I'll review this when I come back. Cheers

olmokramer commented 9 years ago

Rather than adding a new command, the package already hijacks the tree-view:toggle-focus command. You should already be able to use that command to show+focus/hide+unfocus the tree view, or does that not work for you? Even though isVisible() works just fine for me, toggle() doesn't use it...

I'm intentionally overriding commands instead of adding new ones so that people don't have to mess with their keymaps. Most of the tree view commands become useless when the tree view is hidden anyway.

I'm closing this PR because the functionality that it adds should already be in the package.

xcv58 commented 9 years ago

I doesn't work before. But now it works.

Thank you very much!

olmokramer commented 9 years ago

Cool! Closing this one.