mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
* #855 - Support Ukrainian layout; Fix matching of similar layouts * Fix splitting of command line
This commit is contained in:
parent
1eaead4f70
commit
dfd31872a9
@ -4,6 +4,7 @@ from thefuck.utils import memoize, get_alias
|
||||
target_layout = '''qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?'''
|
||||
|
||||
source_layouts = [u'''йцукенгшщзхъфывапролджэячсмитьбю.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,''',
|
||||
u'''йцукенгшщзхїфівапролджєячсмитьбю.ЙЦУКЕНГШЩЗХЇФІВАПРОЛДЖЄЯЧСМИТЬБЮ,''',
|
||||
u'''ضصثقفغعهخحجچشسیبلاتنمکگظطزرذدپو./ًٌٍَُِّْ][}{ؤئيإأآة»«:؛كٓژٰٔء><؟''',
|
||||
u''';ςερτυθιοπ[]ασδφγηξκλ΄ζχψωβνμ,./:΅ΕΡΤΥΘΙΟΠ{}ΑΣΔΦΓΗΞΚΛ¨"ΖΧΨΩΒΝΜ<>?''',
|
||||
u'''/'קראטוןםפ][שדגכעיחלךף,זסבהנמצתץ.QWERTYUIOP{}ASDFGHJKL:"ZXCVBNM<>?''']
|
||||
@ -15,7 +16,14 @@ def _get_matched_layout(command):
|
||||
# result in a non-splitable sript as per shlex
|
||||
cmd = command.script.split(' ')
|
||||
for source_layout in source_layouts:
|
||||
if all([ch in source_layout or ch in '-_' for ch in cmd[0]]):
|
||||
is_all_match = True
|
||||
|
||||
for cmd_part in cmd:
|
||||
if not all([ch in source_layout or ch in '-_' for ch in cmd_part]):
|
||||
is_all_match = False
|
||||
break
|
||||
|
||||
if is_all_match:
|
||||
return source_layout
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user