diff --git a/rc/detection/modeline.kak b/rc/detection/modeline.kak index 1a343448..00d2fcdc 100644 --- a/rc/detection/modeline.kak +++ b/rc/detection/modeline.kak @@ -96,7 +96,7 @@ define-command -hidden modeline-parse-impl %{ # [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] 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\A|.\z %opt{modelines}k %opt{modelines}X \ + execute-keys "s(?S)\A(.+\n){,%opt{modelines}}|(.+\n){,%opt{modelines}}\z" \ s^\S*?\s+?(vim?|kak(oune)?):\s?[^\n]+ evaluate-commands -draft -itersel modeline-parse-impl } }