1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Merge pull request #521 from b1101/master

ui: accept 'q' as quit character
This commit is contained in:
Vladimir Iakovlev 2016-06-27 23:14:16 +03:00 committed by GitHub
commit ea3671f98c
2 changed files with 8 additions and 7 deletions

View File

@ -25,15 +25,16 @@ def test_read_actions(patch_get_key):
# Ignored:
'x', 'y',
# Up:
const.KEY_UP,
const.KEY_UP, 'k',
# Down:
const.KEY_DOWN,
const.KEY_DOWN, 'j',
# Ctrl+C:
const.KEY_CTRL_C])
assert list(islice(ui.read_actions(), 5)) \
const.KEY_CTRL_C, 'q'])
assert list(islice(ui.read_actions(), 8)) \
== [const.ACTION_SELECT, const.ACTION_SELECT,
const.ACTION_PREVIOUS, const.ACTION_NEXT,
const.ACTION_ABORT]
const.ACTION_PREVIOUS, const.ACTION_PREVIOUS,
const.ACTION_NEXT, const.ACTION_NEXT,
const.ACTION_ABORT, const.ACTION_ABORT]
def test_command_selector():

View File

@ -16,7 +16,7 @@ def read_actions():
yield const.ACTION_PREVIOUS
elif key in (const.KEY_DOWN, 'j'):
yield const.ACTION_NEXT
elif key == const.KEY_CTRL_C:
elif key in (const.KEY_CTRL_C, 'q'):
yield const.ACTION_ABORT
elif key in ('\n', '\r'):
yield const.ACTION_SELECT