Merge remote-tracking branch 'lenormf/fix-3733' into master

This commit is contained in:
Maxime Coste 2020-09-17 19:39:48 +10:00
commit fd658f6995
5 changed files with 14 additions and 1 deletions

View File

@ -96,7 +96,7 @@ define-command -hidden modeline-parse-impl %{
# [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] # [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" %{ define-command modeline-parse -docstring "Read and interpret vi-format modelines at the beginning/end of the buffer" %{
try %{ evaluate-commands -draft %{ try %{ evaluate-commands -draft %{
execute-keys <percent> s\A|.\z<ret> %opt{modelines}k <a-x> %opt{modelines}X \ execute-keys <percent> "s(?S)\A(.+\n){,%opt{modelines}}|(.+\n){,%opt{modelines}}\z<ret>" \
s^\S*?\s+?(vim?|kak(oune)?):\s?[^\n]+<ret> <a-x> s^\S*?\s+?(vim?|kak(oune)?):\s?[^\n]+<ret> <a-x>
evaluate-commands -draft -itersel modeline-parse-impl evaluate-commands -draft -itersel modeline-parse-impl
} } } }

View File

@ -0,0 +1,3 @@
:modeline-parse<ret>
%
:exec c %opt{tabstop}<ret>

View File

@ -0,0 +1,7 @@
# kak:tabstop=1:
# kak:tabstop=2:
# kak:tabstop=3:
foo
foo
foo
foo

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,2 @@
source "%val{runtime}/rc/detection/modeline.kak"
set-option global modelines 1