Skip to content

Close help on q/close instead of ignore keypress #1043

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

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

smhc
Copy link
Contributor

@smhc smhc commented Mar 3, 2022

I believe this is better matches expectations when pressing 'q' on the help ui.

Comment on lines +84 to +86
if view.is_help_ui() and action == 'close' then
action = 'toggle_help';
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you toggle the help with g?, why does this need another binding ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more natural to think of it as opening help, then using the generic close to close the current view. Most other "views" in vim works like this. e.g :help vs :q. I hit 'q' every time I am on the help view to close it and feel stuck on that screen until I remember it's the same command to close it as open it.

I don't really see a reason why 'close' should stop working just because the help view is open - having an escape out that works as expected on both screens seems pretty helpful to the user.

No doubt you are comfortable with the current behaviour - but I'm fairly sure new and casual users would agree with the 'q to close either screen' sentiment.

Copy link
Member

@kyazdani42 kyazdani42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. I don't use this feature actually i know the tree pretty well already 😄

@kyazdani42 kyazdani42 merged commit f6aba66 into nvim-tree:master Mar 3, 2022
Almo7aya pushed a commit to Almo7aya/nvim-tree.lua that referenced this pull request Oct 11, 2022
Co-authored-by: Shane Hird <shane.hird@csgicorp.com>
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

Successfully merging this pull request may close these issues.

2 participants