patch 9.1.1145: multi-line completion has wrong indentation for last line
Problem: When expanding omni completion items with newlines (e.g.
`then\n\t\nend`), the end statement gets wrong indentation.
Solution: Add OPENLINE_FORCE_INDENT flag to make open_line() use
second_line_indent directly (glepnir)
closes: #16614
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Justin M. Keyes <justinkz@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 63f0016..82d2ef0 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -1946,6 +1946,23 @@
call VerifyScreenDump(buf, 'Test_pum_with_special_characters_08', {})
call term_sendkeys(buf, "\<C-E>\<Esc>")
+ call term_sendkeys(buf, ":setlocal autoindent tabstop=2 shiftwidth=2\<CR>")
+ call term_sendkeys(buf, "Slocal a = \<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_with_special_characters_09', {})
+
+ call term_sendkeys(buf, "\<C-Y>")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_with_special_characters_10', {})
+
+ call term_sendkeys(buf, "\<ESC>kAlocal b = \<C-X>\<C-O>")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_with_special_characters_11', {})
+
+ call term_sendkeys(buf, "\<C-Y>")
+ call TermWait(buf, 50)
+ call VerifyScreenDump(buf, 'Test_pum_with_special_characters_12', {})
+
call StopVimInTerminal(buf)
endfunc