neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

move_spec.lua (1417B)


      1 local n = require('test.functional.testnvim')()
      2 local Screen = require('test.functional.ui.screen')
      3 
      4 local clear = n.clear
      5 local feed = n.feed
      6 local fn = n.fn
      7 
      8 before_each(clear)
      9 
     10 describe(':move', function()
     11  -- oldtest: Test_move_undo()
     12  it('redraws correctly when undone', function()
     13    local screen = Screen.new(60, 10)
     14 
     15    fn.setline(1, { 'First', 'Second', 'Third', 'Fourth' })
     16    feed('gg:move +1<CR>')
     17    screen:expect([[
     18      Second                                                      |
     19      ^First                                                       |
     20      Third                                                       |
     21      Fourth                                                      |
     22      {1:~                                                           }|*5
     23      :move +1                                                    |
     24    ]])
     25 
     26    -- here the display would show the last few lines scrolled down
     27    feed('u')
     28    feed(':<Esc>')
     29    screen:expect([[
     30      ^First                                                       |
     31      Second                                                      |
     32      Third                                                       |
     33      Fourth                                                      |
     34      {1:~                                                           }|*5
     35                                                                  |
     36    ]])
     37  end)
     38 end)