diff options
author | glepnir <glephunter@gmail.com> | 2025-02-25 14:30:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-25 06:30:21 +0000 |
commit | c9a2b16c4842b5c61af1f57a66637fbd94efba24 (patch) | |
tree | 992f3dd3c008296ff88e2f8ad430594b0128fadf /test | |
parent | 095c0876c2010d6160df37cf057f2d0ad2c4501f (diff) | |
download | rneovim-c9a2b16c4842b5c61af1f57a66637fbd94efba24.tar.gz rneovim-c9a2b16c4842b5c61af1f57a66637fbd94efba24.tar.bz2 rneovim-c9a2b16c4842b5c61af1f57a66637fbd94efba24.zip |
vim-patch:9.1.1145: multi-line completion has wrong indentation for last line (#32625)
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: vim/vim#16614
https://github.com/vim/vim/commit/5090a1fecb86c44be83d55e139ed79b7785fa090
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ui/popupmenu_spec.lua | 46 | ||||
-rw-r--r-- | test/old/testdir/test_popup.vim | 17 |
2 files changed, 63 insertions, 0 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua index 0a28ea2d0a..fe093b67d5 100644 --- a/test/functional/ui/popupmenu_spec.lua +++ b/test/functional/ui/popupmenu_spec.lua @@ -6042,6 +6042,52 @@ describe('builtin popupmenu', function() {2:-- }{5:match 1 of 3} | ]]) feed('<C-E><ESC>') + + command('setlocal autoindent shiftwidth=2 tabstop=2') + feed('Slocal a = <C-X><C-O>') + screen:expect([[ + local a = {8:func ()} | + {8: } | + {8:end}^ | + {1:~ }{s: function () }{1: }| + {1:~ }{n: foobar }{1: }| + {1:~ }{n: 你好^@ ^@我好 }{1: }| + {1:~ }|*13 + {2:-- }{5:match 1 of 3} | + ]]) + + feed('<C-Y>') + screen:expect([[ + local a = {8:func ()} | + {8: } | + end^ | + {1:~ }|*16 + {2:-- INSERT --} | + ]]) + + feed('<ESC>kAlocal b = <C-X><C-O>') + screen:expect([[ + local a = {8:func ()} | + local b = {8:func ()} | + {8: } | + {8: end}^ | + end {s: function () } | + {1:~ }{n: foobar }{1: }| + {1:~ }{n: 你好^@ ^@我好 }{1: }| + {1:~ }|*12 + {2:-- }{5:match 1 of 3} | + ]]) + + feed('<C-Y>') + screen:expect([[ + local a = {8:func ()} | + local b = {8:func ()} | + {8: } | + end^ | + end | + {1:~ }|*14 + {2:-- INSERT --} | + ]]) end) end end diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 41b694860c..0b88fd1dba 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1937,6 +1937,23 @@ func Test_pum_complete_with_special_characters() 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 |