mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-28 22:22:41 +03:00
Merge remote-tracking branch 'lenormf/fix-3733' into master
This commit is contained in:
commit
fd658f6995
@ -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 <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>
|
||||
evaluate-commands -draft -itersel modeline-parse-impl
|
||||
} }
|
||||
|
@ -0,0 +1,3 @@
|
||||
:modeline-parse<ret>
|
||||
%
|
||||
:exec c %opt{tabstop}<ret>
|
7
test/regression/3733-modeline-parsing-off-by-one-line/in
Normal file
7
test/regression/3733-modeline-parsing-off-by-one-line/in
Normal file
@ -0,0 +1,7 @@
|
||||
# kak:tabstop=1:
|
||||
# kak:tabstop=2:
|
||||
# kak:tabstop=3:
|
||||
foo
|
||||
foo
|
||||
foo
|
||||
foo
|
@ -0,0 +1 @@
|
||||
1
|
2
test/regression/3733-modeline-parsing-off-by-one-line/rc
Normal file
2
test/regression/3733-modeline-parsing-off-by-one-line/rc
Normal file
@ -0,0 +1,2 @@
|
||||
source "%val{runtime}/rc/detection/modeline.kak"
|
||||
set-option global modelines 1
|
Loading…
Reference in New Issue
Block a user