Skip to content

Refactor and fix keybinding issue (fixes #447)#451

Merged
sebastinas merged 3 commits intobpython:masterfrom
keyan:bug447
Jan 22, 2015
Merged

Refactor and fix keybinding issue (fixes #447)#451
sebastinas merged 3 commits intobpython:masterfrom
keyan:bug447

Conversation

@keyan
Copy link
Copy Markdown
Contributor

@keyan keyan commented Jan 21, 2015

This changes the logic for the function get_key_no_doublebind() and removes the mutable list which was previously used to keep track of keybindings which were already assigned. Although this fix passes the test cases and the specific case mentioned in #447, the logic is such that specifying the same custom keybinding for two commands will result in only one command being bound. Also I am getting 12 skipped tests when running nosetests, any ideas why this is happening?

With:
help = F9
show_source = F9

F9 is mapped to show_source and help is not mapped to any key. I think this is because the keybindings are assigned sequentially so because show_source is assigned first (line 182) vs help (line 210).

I think this is still a substantial improvement over the old code because it is easier to understand and has more functionality than before. Although the problem of correctly handling custom keybinding is not completely resolved. Knowing the exact desired functionality would be helpful though.

keyan added 2 commits January 21, 2015 13:47
This changes the logic for the function get_key_no_doublebind() and removes the mutable list which was previously used to keep track of keybindings which were already used. Although this fix passes the test cases and the specific case mentioned in #447, the behavior is such that specifying the same custom keybinding for two commands will result in only one command being bound.
@keyan
Copy link
Copy Markdown
Contributor Author

keyan commented Jan 21, 2015

Thanks Sebastian, so I'm having an issue passing the test_keybindings_default_contains_no_duplicates() test for some reason. But I'm working on it. Please ignore the messy branch management, I'm still getting the hang of that.

@keyan
Copy link
Copy Markdown
Contributor Author

keyan commented Jan 21, 2015

Fixed the merge conflicts and also passes the new tests. The issue was that kill_line and cut_to_buffer had the same default key assigned, their functionality was also the same. I removed kill_line and changed manual_readline.py to reflect this.

sebastinas added a commit that referenced this pull request Jan 22, 2015
Refactor and fix keybinding issue (fixes #447)
@sebastinas sebastinas merged commit e457d07 into bpython:master Jan 22, 2015
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