diff options
author | erw7 <erw7.github@gmail.com> | 2019-05-23 01:47:56 +0900 |
---|---|---|
committer | erw7 <erw7.github@gmail.com> | 2020-02-12 15:16:32 +0900 |
commit | 3ca0343fb99b7f7412fca73be6f94df252b6f0a3 (patch) | |
tree | a9d41540a97c3f6239ad8034998fd78b52bd7a19 /test/functional/legacy/prompt_buffer_spec.lua | |
parent | 4813ad48cd12a03ca50c01ac1b20518bf4df57f2 (diff) | |
download | rneovim-3ca0343fb99b7f7412fca73be6f94df252b6f0a3.tar.gz rneovim-3ca0343fb99b7f7412fca73be6f94df252b6f0a3.tar.bz2 rneovim-3ca0343fb99b7f7412fca73be6f94df252b6f0a3.zip |
vim-patch:8.1.0032: BS in prompt buffer starts new line
Problem: BS in prompt buffer starts new line.
Solution: Do not allows BS over the prompt. Make term_sendkeys() handle
special keys. Add a test.
https://github.com/vim/vim/commit/6b810d92a9cd9378ab46ea0db07079cb789f9faa
Diffstat (limited to 'test/functional/legacy/prompt_buffer_spec.lua')
-rw-r--r-- | test/functional/legacy/prompt_buffer_spec.lua | 80 |
1 files changed, 74 insertions, 6 deletions
diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua index 749e65a985..d494bb5a81 100644 --- a/test/functional/legacy/prompt_buffer_spec.lua +++ b/test/functional/legacy/prompt_buffer_spec.lua @@ -28,6 +28,11 @@ describe('prompt buffer', function() call append(line("$") - 1, 'Result: "' . a:text .'"') endfunc ]]) + feed_command("set noshowmode | set laststatus=0") + feed_command("call setline(1, 'other buffer')") + feed_command("new") + feed_command("set buftype=prompt") + feed_command("call prompt_setcallback(bufnr(''), function('TextEntered'))") end) after_each(function() @@ -35,11 +40,6 @@ describe('prompt buffer', function() end) it('works', function() - feed_command("set noshowmode | set laststatus=0") - feed_command("call setline(1, 'other buffer')") - feed_command("new") - feed_command("set buftype=prompt") - feed_command("call prompt_setcallback(bufnr(''), function('TextEntered'))") screen:expect([[ ^ | ~ | @@ -52,7 +52,7 @@ describe('prompt buffer', function() ~ | | ]]) - feed_command("startinsert") + feed("i") feed("hello\n") screen:expect([[ % hello | @@ -81,4 +81,72 @@ describe('prompt buffer', function() ]]) end) + it('editing', function() + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + [Scratch] | + other buffer | + ~ | + ~ | + ~ | + | + ]]) + feed("i") + feed("hello<BS><BS>") + screen:expect([[ + % hel^ | + ~ | + ~ | + ~ | + [Scratch] | + other buffer | + ~ | + ~ | + ~ | + | + ]]) + feed("<Left><Left><Left><BS>-") + screen:expect([[ + % -^hel | + ~ | + ~ | + ~ | + [Scratch] | + other buffer | + ~ | + ~ | + ~ | + | + ]]) + feed("<End>x") + screen:expect([[ + % -helx^ | + ~ | + ~ | + ~ | + [Scratch] | + other buffer | + ~ | + ~ | + ~ | + | + ]]) + feed("<C-U>exit\n") + screen:expect([[ + ^other buffer | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + ~ | + | + ]]) + end) + end) |