Repository: neovim/neovim
File: test/functional/ui/messages2_spec.lua (Lua)

Code before:
      {1:~                                                    }|*3
      {3:─────────────────────────────────────────────────────}|
      0                                                    |
      1                                                    |
      2                                                    |
      3                                                    |
      4                                                    |
      5                                                    |
      6 [+93]                                              |
      Type number and <Enter> or click with the mouse (q or|
       empty cancels): ^                                    |
    ]]
    feed(':call inputlist(range(100))<CR>')
    screen:expect(top)
    feed('j')
    screen:expect([[
                                                           |
      {1:~                                                    }|*3
      {3:─────────────────────────────────────────────────────}|
      1 [+1]                                               |
      2                                                    |
      3                                                    |
      4                                                    |
      5                                                    |
      6                                                    |
      7 [+92]                                              |
      Type number and <Enter> or click with the mouse (q or|
       empty cancels): ^                                    |
    ]])
    feed('k')
    screen:expect(top)
    feed('d')
    screen:expect([[
                                                           |
      {1:~                                                    }|*3
      {3:─────────────────────────────────────────────────────}|
      3 [+3]                                               |
      4                                                    |
      5                                                    |
      6                                                    |
      7                                                    |
      8                                                    |
      9 [+90]                                              |
      Type number and <Enter> or click with the mouse (q or|
       empty cancels): ^                                    |
    ]])
    feed('u')
    screen:expect(top)
    feed('f')
    screen:expect([[
                                                           |

Review comment (suggestion):
Getting this to work was a bit tricky/messy. And representing a scroll bar like this may be a bit arbitrary, but we are already using it to indicate spilled lines in the cmdline. It seems more useful to me than the current message grid behavior, which only allows scrolling until the cmdline prompt is reached, with the text `--More--` at the bottom.

Code after:
                                                                             |
      {1:~                                                                      }|*4
      {3:───────────────────────────────────────────────────────────────────────}|
      0                                                                      |
      1                                                                      |
      2                                                                      |
      3                                                                      |
      4                                                                      |
      5                                                                      |
      6 [+93]                                                                |
      Type number and <Enter> or click with the mouse (q or empty cancels): ^ |
    ]]
    feed(':call inputlist(range(100))<CR>')
    screen:expect(top)
    feed('j')
    screen:expect([[
                                                                             |
      {1:~                                                                      }|*4
      {3:───────────────────────────────────────────────────────────────────────}|
      1 [+1]                                                                 |
      2                                                                      |
      3                                                                      |
      4                                                                      |
      5                                                                      |
      6                                                                      |
      7 [+92]                                                                |
      Type number and <Enter> or click with the mouse (q or empty cancels): ^ |
    ]])
    feed('k')
    screen:expect(top)
    feed('d')
    screen:expect([[
                                                                             |
      {1:~                                                                      }|*4
      {3:───────────────────────────────────────────────────────────────────────}|
      3 [+3]                                                                 |
      4                                                                      |
      5                                                                      |
      6                                                                      |
      7                                                                      |
      8                                                                      |
      9 [+90]                                                                |
      Type number and <Enter> or click with the mouse (q or empty cancels): ^ |
    ]])
    feed('u')
    screen:expect(top)
    feed('f')
    screen:expect([[
                                                                             |
      {1:~                                                                      }|*4
      {3:───────────────────────────────────────────────────────────────────────}|