Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Clear Keybindings functionality #92

Merged
merged 4 commits into from
Dec 29, 2017

Conversation

tokamak-git
Copy link
Contributor

Hello all,
The pr adds the ability to reset keybindings so as to start afresh. this is done by simply ui.Keybindings = make([]*keybindings, 0)
Your feedback is more than welcome

@marcusolsson
Copy link
Owner

Thanks for wanting to contribute!

Just spitballing here but to me the word "Reset" implies returning to a semantically default state. This is sort of the case here but my gut feeling would tell me that "Reset" could be something more than just removing all keybindings. For example, if there were standard keybindings like Esc for quitting, that would persist even after removing them, then Reset could be appropriate. How about "ClearKeybindings" maybe?

@tokamak-git
Copy link
Contributor Author

Hmm, I take your point. For example for my project I may use ResetKeybindings() to first clear all keybindings and then set the exit mechanism.

ui_tcell.go Outdated
@@ -64,6 +64,12 @@ func (ui *tcellUI) SetKeybinding(seq string, fn func()) {
})
}

// ClearKeygindings reinitializes the keybindings so as to revert to the
Copy link
Owner

Choose a reason for hiding this comment

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

Typo in documentation.

@tokamak-git tokamak-git changed the title Reset Keybindings functionality Clear Keybindings functionality Dec 29, 2017
@marcusolsson
Copy link
Owner

Thank you! 👍

@marcusolsson marcusolsson merged commit e1f1eca into marcusolsson:master Dec 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants