diff --git a/editor.c b/editor.c index 607faa3..73aba62 100644 --- a/editor.c +++ b/editor.c @@ -2537,7 +2537,7 @@ static int _editor_init_from_args(editor_t *editor, int argc, char **argv) { } break; case 'y': - editor->syntax_override = strcmp(optarg, "-") == 0 ? "syn_generic" : optarg; + editor->syntax_override = strcmp(optarg, "y") == 0 ? "syn_generic" : optarg; break; case 'z': editor->trim_paste = atoi(optarg) ? 1 : 0; diff --git a/tests/func/test_syntax.sh b/tests/func/test_syntax.sh index 7c3e236..31376aa 100755 --- a/tests/func/test_syntax.sh +++ b/tests/func/test_syntax.sh @@ -38,7 +38,7 @@ bbb "aaa" bbb "aaa" bbb bbb "aaa \" aaa" bbb "aaa \" aaa" bbb bbb "aaa \" aaa\\" bbb "aaa \" aaa\\" bbb EOD -extra_opts=(-y- $tmpf) +extra_opts=(-yy $tmpf) macro='' declare -A expected declare -A not_expected @@ -63,7 +63,7 @@ cat >$tmpf <<"EOD" /*bb"bb*/ "aa/*aa" /*bb"bb"bb*/ "aa/*aa*/aa" EOD -extra_opts=(-y- $tmpf) +extra_opts=(-yy $tmpf) macro='' declare -A expected declare -A not_expected