mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-19 04:21:14 +00:00
Adapt the tmux
rule to #324
This commit is contained in:
parent
8374be0872
commit
88732a608e
@ -16,4 +16,4 @@ def test_match(tmux_ambiguous):
|
|||||||
|
|
||||||
def test_get_new_command(tmux_ambiguous):
|
def test_get_new_command(tmux_ambiguous):
|
||||||
assert get_new_command(Command('tmux list', stderr=tmux_ambiguous), None)\
|
assert get_new_command(Command('tmux list', stderr=tmux_ambiguous), None)\
|
||||||
== 'tmux list-keys'
|
== ['tmux list-keys', 'tmux list-panes', 'tmux list-windows']
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from thefuck.utils import get_closest, replace_argument
|
from thefuck.utils import get_closest, replace_command
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
@ -15,6 +15,4 @@ def get_new_command(command, settings):
|
|||||||
old_cmd = cmd.group(1)
|
old_cmd = cmd.group(1)
|
||||||
suggestions = [cmd.strip() for cmd in cmd.group(2).split(',')]
|
suggestions = [cmd.strip() for cmd in cmd.group(2).split(',')]
|
||||||
|
|
||||||
new_cmd = get_closest(old_cmd, suggestions)
|
return replace_command(command, old_cmd, suggestions)
|
||||||
|
|
||||||
return replace_argument(command.script, old_cmd, new_cmd)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user