Feature: permit blockquote automatic continuation (issue #1274) (fixed)

This commit is contained in:
Tinmarino
2023-03-17 02:27:08 -03:00
parent 6993610585
commit cde5dbc92a
6 changed files with 189 additions and 20 deletions
+75
View File
@@ -0,0 +1,75 @@
# Issue: #1274
# Feature: Markdown -- Continue blockquote when <CR> is pressed in insert mode.
Given vimwiki (Blockquote with test {{{1):
> Dummy text 1
Execute (Set syntax markdown):
call SetSyntax('markdown')
Do (Press insert, enter and type):
A
\<Cr>
Dummy text 2
Expect(Marker added 1):
> Dummy text 1
> Dummy text 2
Do (Press o and type):
o
Dummy text 2
Expect(Marker added 2):
> Dummy text 1
> Dummy text 2
Do (Press O and type):
O
Dummy text 2
Expect(Marker added 3, above):
> Dummy text 2
> Dummy text 1
Given vimwiki (Blockquote without test {{{1):
>
Do (Press insert, enter and type):
A
\<Cr>
Dummy text 2
Expect(Marker removed):
Dummy text 2
Do (Press o):
o
Dummy text 2
Expect(Marker appended, below):
>
> Dummy text 2
Do (Press O):
O
Dummy text 2
Expect(Marker appended, above):
> Dummy text 2
>
+7
View File
@@ -5,13 +5,20 @@ Before(Define function for yaml inspection):
function! Issue1287Yaml(line)
" The line where the yaml delimiter is: 1 if at top
let l = a:line
Log "1: " . string(GetSyntaxStack(l + 0, 2))
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 0, 2)[0]
Log '2: ' . string(GetSyntaxStack(l + 0, 2))
AssertEqual 'VimwikiPre', GetSyntaxStack(l + 0, 2)[1]
Log '3: ' . string(GetSyntaxStack(l + 1, 2))
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 1, 2)[0]
Log '4: ' . string(GetSyntaxStack(l + 2, 2))
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 2, 2)[0]
Log '5: ' . string(GetSyntaxStack(l + 2, 20))
AssertEqual 'textSnipYAML', GetSyntaxStack(l + 2, 20)[0]
Log '6: ' . string(GetSyntaxStack(l + 3, 2))
AssertEqual 'VimwikiPre', GetSyntaxStack(l + 3, 2)[-1]
endfunction