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

feat(treesitter): add q mapping to playground to close playground #22123

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theHamsta
Copy link
Member

I don't whether this is in scope for the built-in playground, but my muscle memory always wants to use q to close the built-in playground, because I'm used to this from other plugins to have this for these small UI helper windows.

Feel free to close if not suited as a default.

@marvim marvim requested a review from a team February 4, 2023 19:27
@@ -452,6 +452,9 @@ function M.show_tree(opts)
pg:draw(b)
end,
})
a.nvim_buf_set_keymap(b, 'n', 'q', '<cmd>q!<cr>', {
desc = 'Close playground',
Copy link
Member Author

Choose a reason for hiding this comment

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

A bit unsure on how to call this playground is not shown publicly. Close tree-sitter syntax window?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the map is buffer-local, I would think it should simply be "Close the current window" (or "Quit the current window"—the docs seem to use both terms interchangeably).

@noahfrederick
Copy link
Contributor

I don't think shadowing q is appropriate. For reference, Fugitive maps gq to close its status window (shadowing gq is fine because the buffer is read-only).

Also, is there a reason to opt for <Cmd>quit!<CR> instead of <C-W>c?

@theHamsta theHamsta force-pushed the playground-quit-mapping branch 2 times, most recently from 8e6a59a to 5065b86 Compare February 4, 2023 21:38
@theHamsta theHamsta marked this pull request as draft February 5, 2023 00:05
@marvim marvim removed the request for review from a team February 5, 2023 00:06
@zeertzjq zeertzjq removed the lua stdlib label Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants