diff --git a/rc/detection/modeline.kak b/rc/detection/modeline.kak index 516080db..dc092a1c 100644 --- a/rc/detection/modeline.kak +++ b/rc/detection/modeline.kak @@ -65,7 +65,7 @@ define-command -hidden modeline-parse-impl %{ case "${kak_selection}" in *vi:*|*vim:*) type_selection="vim";; *kak:*|*kakoune:*) type_selection="kakoune";; - *) printf 'echo -debug Unsupported modeline format' \ + *) printf 'echo -debug %s' "$(kakquote "Unsupported modeline format: ${kak_selection}")" \ | kak -p "${kak_session}"; exit 1 ;; esac @@ -109,7 +109,7 @@ define-command -hidden modeline-parse-impl %{ define-command modeline-parse -docstring "Read and interpret vi-format modelines at the beginning/end of the buffer" %{ try %{ evaluate-commands -draft %{ execute-keys "s(?S)\A(.+\n){,%opt{modelines}}|(.+\n){,%opt{modelines}}\z" \ - s^\S*?\s+?(vim?|kak(oune)?):\s?[^\n]+ + s^\S*?\s+?\w+:\s?[^\n]+ evaluate-commands -draft -itersel modeline-parse-impl } } }