mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
ui: accept 'q' as quit character
'q' is a standard character used in traditional UNIX environment for 'quit', so it makes sense to support it in my opinion
This commit is contained in:
parent
42853f41bb
commit
01418526b4
@ -25,15 +25,16 @@ def test_read_actions(patch_get_key):
|
|||||||
# Ignored:
|
# Ignored:
|
||||||
'x', 'y',
|
'x', 'y',
|
||||||
# Up:
|
# Up:
|
||||||
const.KEY_UP,
|
const.KEY_UP, 'k',
|
||||||
# Down:
|
# Down:
|
||||||
const.KEY_DOWN,
|
const.KEY_DOWN, 'j',
|
||||||
# Ctrl+C:
|
# Ctrl+C:
|
||||||
const.KEY_CTRL_C])
|
const.KEY_CTRL_C, 'q'])
|
||||||
assert list(islice(ui.read_actions(), 5)) \
|
assert list(islice(ui.read_actions(), 8)) \
|
||||||
== [const.ACTION_SELECT, const.ACTION_SELECT,
|
== [const.ACTION_SELECT, const.ACTION_SELECT,
|
||||||
const.ACTION_PREVIOUS, const.ACTION_NEXT,
|
const.ACTION_PREVIOUS, const.ACTION_PREVIOUS,
|
||||||
const.ACTION_ABORT]
|
const.ACTION_NEXT, const.ACTION_NEXT,
|
||||||
|
const.ACTION_ABORT, const.ACTION_ABORT]
|
||||||
|
|
||||||
|
|
||||||
def test_command_selector():
|
def test_command_selector():
|
||||||
|
@ -16,7 +16,7 @@ def read_actions():
|
|||||||
yield const.ACTION_PREVIOUS
|
yield const.ACTION_PREVIOUS
|
||||||
elif key in (const.KEY_DOWN, 'j'):
|
elif key in (const.KEY_DOWN, 'j'):
|
||||||
yield const.ACTION_NEXT
|
yield const.ACTION_NEXT
|
||||||
elif key == const.KEY_CTRL_C:
|
elif key in (const.KEY_CTRL_C, 'q'):
|
||||||
yield const.ACTION_ABORT
|
yield const.ACTION_ABORT
|
||||||
elif key in ('\n', '\r'):
|
elif key in ('\n', '\r'):
|
||||||
yield const.ACTION_SELECT
|
yield const.ACTION_SELECT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user